Solved

Simple Struts question

Posted on 2006-11-20
5
176 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
ID: 17983028
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
ID: 17984265
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
ID: 17985707
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
ID: 17986607
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
ID: 17987235
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
console vs log file 16 77
TreeSet comparator example 7 90
spring example non maven 4 82
countXY challenge 28 145
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

21 Experts available now in Live!

Get 1:1 Help Now