Solved

Simple Struts question

Posted on 2006-11-20
5
175 Views
Last Modified: 2010-04-01
Hi,

what is the tag html:html for ?
I can see in the doc :

html      

Render an HTML <html> Element
Renders an HTML <html> element with language attributes extracted from the user's current Locale object, if there is one.

But I don't understand the difference with simple html tag.

Also for html:link, what's the difference with the a tag ?
etcetera.

(what do they mean with "render" ?
0
Comment
Question by:matthew016
5 Comments
 
LVL 9

Accepted Solution

by:
owenli27 earned 168 total points
Comment Utility
render means "acting like" or "can be transferred as"
- html:html is same as <html> except for that you can added a couple of attributes in html:html, such as @lang
- html:link is more powerful than <a>, it support many attributes, for exmaple, you can link a action name as:  <html:link forward="OneActionForwardName" name="aName"> abcd </html:link>.  All ActionForwards should be specified in struts-config.xml
0
 
LVL 10

Assisted Solution

by:jaggernat
jaggernat earned 166 total points
Comment Utility
all your struts tags when submitted to server transform into normal html tags. you can design the page using struts tags, but when you right click and "view source", you will see all struts tags converted to html tags.
as owenli said,<html:html> and <html:link> lets you specify additional attributes to the tags so you have more options to play around.
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
owenli,
with simple <a> tag I can put an action too, no ? like <a href="MyAction.do?method=myCustomMethod" ....
didn't udnerstand the advantage
0
 
LVL 14

Assisted Solution

by:boonleng
boonleng earned 166 total points
Comment Utility
The <a> tag won't append any context path(if any) in front the action whereas struts tag can.
Assume the contex path is "/Project1", then the following
<html:link action="MyAction"> will render as <a href="/Project1/MyAction.do">
You dont need to change the link if the path changed.


0
 
LVL 9

Expert Comment

by:owenli27
Comment Utility
For appending parameters to hyperlink,  <html:link action="MyAction" paramId="pName" paramName="officeForm" paramProperty="username" />
is equal to  <a href="/Project1/MyAction.do?pName=<%=officeForm.getUsername()%>">    
It is only optional to use html:link and some developers never use it.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now