aspose file tools*
The moose likes Other Open Source Projects and the fly likes url rewriting using UrlRewriteFilter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "url rewriting using UrlRewriteFilter" Watch "url rewriting using UrlRewriteFilter" New topic
Author

url rewriting using UrlRewriteFilter

C Das
Greenhorn

Joined: Mar 12, 2009
Posts: 4
hi, can someone help me please.

I need to transform a site to be SEO friendly. I'm using UrlRewriteFilter. As I understand it, for the outbound url to be translated by UrlRewriteFilter, I have to use either the scriptlet <%= response.encodeURL("something.do?param1=value1¶m2=value2") or the jstl <c:url value="something.do?param1=value1¶m2=value2" /> and these urls can then be translated properly to /something/value1/value2 automatically by UrlRewriteFilter.

The problem is, I'm building the url in javascript and so I cannot pass the javascript variable in both of them as they are server side. e.g.

document.form['formname'].action = '<%= response.encodeURL(javascriptUrl) %>' -----> not allowed

so my question is, how can I go about translating the url.

By the way, I assign the document.form.action upon onClick in the button like the following.

<input type="button" value="submit" onClick="var javascriptUrl = generateUrl(); document.form['formname'].action = '<%= response.encodeURL(javascriptUrl) %>'; document.form['formname'].submit();" />
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: url rewriting using UrlRewriteFilter
 
Similar Threads
Submitting a Form Using A Link ....
Using IFRAMES
linking struts2 action to pre-existing pure Java servlet
getting null value, from a variable being sent from JavaScript in the page
calling a servlet from javascript function??