*
The moose likes Servlets and the fly likes Https url redirection 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 "Https url redirection" Watch "Https url redirection" New topic
Author

Https url redirection

Sourab su
Greenhorn

Joined: Sep 24, 2012
Posts: 3
Hi All

We are using proxy-1.0.2.jar in our application and need to POST xml payload to the redirected URL.
When we do a redirect to https url it's not working. But other http or static ip address is working fine. Do we need to do any extra configuration for https url in proxy filter?

Sample urls,

https url - https://abc.com/request/listing (not working)
http url - http://xx.xx.xx.xx:8080/request/listing (working)
http url - http://127.0.0.3:8080/request/listing (working)

in web.xml we have the below entries

<servlet-mapping>
<servlet-name>listingProxyServlet</servlet-name>
<url-pattern>/proxy/listing</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>listingProxyServlet</servlet-name>
<servlet-class>com.woonoz.proxy.servlet.ProxyServlet</servlet-class>
<init-param>
<param-name>target-url</param-name>
<param-value>https://abc.com/request/listing</param-value>
</init-param>
</servlet>

Please help us to resolve this issue.

Regards,
Sourabh,
Dhaval J. Patel
Ranch Hand

Joined: Mar 10, 2011
Posts: 90

I am not sure if you took this into consideration but https uses port 443
Sourab su
Greenhorn

Joined: Sep 24, 2012
Posts: 3
yes, i tried with port 443 as well. still it's not working

Regards,
Sourabh
Sourab su
Greenhorn

Joined: Sep 24, 2012
Posts: 3
I found one solution and posting here. it may helpful for others

I have used HTTP proxy servlet ver. 2.6 and it's working fine

http://www.servletsuite.com/servlets/httpproxy.htm

<servlet>
<servlet-name>accertifyListingProxyServlet</servlet-name>
<servlet-class>com.jsos.httpproxy.HttpProxyServlet</servlet-class>
<init-param>
<param-name>host</param-name>
<param-value>https://abc.com/order</param-value>
</init-param>
<init-param>
<param-name>headers</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</servlet>


Regards,
Sourabh
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Https url redirection