JMohasin
JMohasin

Reputation: 533

Struts1 Preety url

<servlet-mapping>
    <servlet-name>action</servlet-name>
    <!--<url-pattern>*.do</url-pattern>-->
    <url-pattern>/</url-pattern>
</servlet-mapping>

I am doing like this to obtain my url seo friendly. Now i am facing a problem is that to my one of my controller i am passing parameter : test1.in as

http://www.myweb.com/manage/test1.in

So in manage action servlet i get the parameter as test1 but not test1.in, can somebody tell me how to do this?

Upvotes: 0

Views: 138

Answers (1)

JMohasin
JMohasin

Reputation: 533

Friends, finally i got solution to this problem is : using request object

String requestUrlTemp = new String(request.getRequestURL());
String requestUrl = "";   
requestUrl= URLDecoder.decode(requestUrlTemp, "UTF-8" );

Upvotes: 1

Related Questions