?
Solved

Simple Struts question

Posted on 2006-11-20
5
Medium Priority
?
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
owenli27 earned 672 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 664 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 664 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The well known Cerber ransomware continues to spread this summer through spear phishing email campaigns targeting enterprises. Learn how it easily bypasses traditional defenses - and what you can do to protect your data.
The Summer 2017 Scholarship Winners have been announced!
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

770 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