This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes equivalent of html:rewrite in struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "equivalent of html:rewrite in struts2" Watch "equivalent of html:rewrite in struts2" New topic
Author

equivalent of html:rewrite in struts2

yash wardhan
Ranch Hand

Joined: Jan 22, 2008
Posts: 46
Hi,
Can anyone tell me what is the equivalent of html:rewrite of struts 1.x in strits 2.

I have used html:rewrite in src of script tag.
Now I want to know how do I achive the same functionality in struts 2.
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Is it <s:url ...> what you are looking for?
( http://struts.apache.org/2.0.11.2/docs/url.html )
yash wardhan
Ranch Hand

Joined: Jan 22, 2008
Posts: 46
Thanks for reply Joachim,
I tried <s:url ...> also it is working fine when used with
<a href="<s:url...>">
But if I try to use it in script tag as follows,
<script src="<s:url ...>"></script>
In the above tag it is not working.
Where as <html:rewrite ...> works fine in both the above tags.

Any idea about how can we achive above functionality in struts 2.

Thanks
yash wardhan
Ranch Hand

Joined: Jan 22, 2008
Posts: 46
I did not find anything to achive the above functionality so used
<script src="<c:url value='...'/>">


Regards.
 
wood burning stoves
 
subject: equivalent of html:rewrite in struts2
 
Similar Threads
Help regarding the html:rewrite Struts tag
struts-html:base tag equivalent for Struts2?
Unable to load CSS
html:rewrite without the rewrite ?
Struts 1.24 - Problem with 'module' attribute of html:rewrite