File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes getting exact url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getting exact url" Watch "getting exact url" New topic
Author

getting exact url

sandhya sri
Greenhorn

Joined: Feb 11, 2009
Posts: 16
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

Joined: Feb 24, 2006
Posts: 6661
    
    5

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 ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
sandhya sri
Greenhorn

Joined: Feb 11, 2009
Posts: 16
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

Joined: Apr 24, 2009
Posts: 23
You can use "~" as separator instead.


Thanking the green horns sincerely,
Nandha
sandhya sri
Greenhorn

Joined: Feb 11, 2009
Posts: 16
but '~' is also unsafe character for url as per

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm?state=none&origval=%26&enc=on
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting exact url