• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

how to encode the url in strut2

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

How to encode the url in strut2
as i have this url.
inscreenlist!show.action?candidate_id=<s:property value="candidate_id" />

Please help me.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you actually trying to accomplish? Do you really want to encode the string "<s:property..." or do you want the value of the candidate ID?

If the latter, it depends on how you're trying to generate the URL, so without more info, it's tough to help.

If the former, why?!>
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to encode this .

<s:property value="candidate_id" />
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...

Do you want the tag itself in the URL, or do you want the candidate's ID in the URL (like as a parameter)?

I wrote: If the latter, ***it depends on how you're trying to generate the URL***, so without more info, it's tough to help.


 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rather than going back and forth several more times, I'll just throw out some random answers, and maybe one of them will be the one you need.That's assuming candidate_id is an action property or accessible in the stack.
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but how it will encode the url.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://struts.apache.org/2.1.6/docs/url.html

Look at the "encode" and "escapeAmp" attributes.

Have you even *tried* it to just *SEE* how the URL is encoded?!
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi use like this

<s:url id="theUrl" action="jobapply" method="add" encode="true" escapeAmp="true" >
<s:param name="jobCode" value="jobCode" />
<s:param name="jobId" value="jobCode"/>
</s:url>
<a href="<s:property value="#theUrl"/>">Apply Online</a>

and i am getting url like this.

http://localhost:8080/cyberq/jobapply!add.action?jobCode=101&jobId=101

Still it not encoded my url values.
 
Whatever. Here's a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic