Solved

Simple Struts question

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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