Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting exact url

 
sandhya sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an url like

http://details/12345

and what I need to do is ,I have to append a string to that url like

http://details/12345+example_string

for this I wrote a outbound-rule and rule in urlrewrite.xml

<outbound-rule>
<from>/details.do(.*)Id=([0-9A-Za-z_+]+)</from>
<to>/details/$2</to>
</outbound-rule>

<rule>
<from>/details/([0-9A-Za-z_+]+)</from>
<to>/details.do?reviewId=$1</to>
</rule>


but when I click on specified link in my application which go for this url,

http:///details/12345%2Bexample_string("+" is replaced by %2B)

but I need url exactly like

http://details/12345+example_string

because I need to seperate 12345 and "example_string" again in my action class with seperator "+"

but Im not able to do this.

can anyone help me in resolving this issue!!!
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your URL is being encoded

URL Encoding

I am not sure what an outbound rule is. But If you want to pass the data why not just use 2 parameters ?
 
sandhya sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I use two parameters,I need to give '/' as seperator between thoes two parametaers ,but my requirement is I have to append a string after the Id with "+",that's why I hd taken it as single parameter.


 
Nandhakumar Soundarrajan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use "~" as separator instead.
 
sandhya sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but '~' is also unsafe character for url as per

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm?state=none&origval=%26&enc=on
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic