Solved

Simple Struts question

Posted on 2006-11-20
5
179 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Spring MVC - sending raw charset to backend 3 245
Handle form fields in spring mvc controller 1 72
how to add new optional parameter to JSP 1 55
web application structure 18 114
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In order to fulfill our mission of inspiring learning in the technology community, Experts Exchange is launching a Course of the Month program. Premium and Team Account members will have access to one course per month as a part of their membership, …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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