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 Weird Servlet Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Weird Servlet Error" Watch "Weird Servlet Error" New topic
Author

Weird Servlet Error

B Wiley Snyder
Ranch Hand

Joined: Nov 26, 2003
Posts: 50
Hello again,
I'm getting a weird error...

java.lang.IllegalArgumentException: Path https://secure.authorize.net/gateway/transact.dll does not start with a "/" character
com.shoponlinesecure.order.AddHashAndForward.doPost(AddHashAndForward.java:35)
javax.servlet.http.HttpServlet.service(HttpServlet.java:768)
javax.servlet.http.HttpServlet.service(HttpServlet.java:861)

this is the code thats generating it and there is no "/" character in my path and it was working fine 15 mins ago??? Any ideas?

Susanta Chatterjee
Ranch Hand

Joined: Aug 12, 2002
Posts: 102
Are you sure, you want to "forward" in stead of "redirect"?

If you do "forward", then URI must be in the same Context, and hence must start with "/" character.
B Wiley Snyder
Ranch Hand

Joined: Nov 26, 2003
Posts: 50
Originally posted by Susanta Chatterjee:
Are you sure, you want to "forward" in stead of "redirect"?

If you do "forward", then URI must be in the same Context, and hence must start with "/" character.



I see, my problem is I need to post the info. When you redirect that uses get right? And I wouldn't be posting to my URL anymore. Is there a way to solve this problem?

Susanta Chatterjee
Ranch Hand

Joined: Aug 12, 2002
Posts: 102
Hi,

I am not sure, whether this can be achieved any way. Somebody else may be able to come with brighter idea.

But, why do you need to post the information - because as you are doing it from your application, nobody will be able to access the URL (unless you log it somewhere). So, a "HTTP Get" does not violate any security.

All you have to do is to rewrite your request parameters to the URL, so that the application which recieves it can access them. I am still not sure what to do if you have documents to send.
B Wiley Snyder
Ranch Hand

Joined: Nov 26, 2003
Posts: 50
Originally posted by Susanta Chatterjee:
Hi,

I am not sure, whether this can be achieved any way. Somebody else may be able to come with brighter idea.

But, why do you need to post the information - because as you are doing it from your application, nobody will be able to access the URL (unless you log it somewhere). So, a "HTTP Get" does not violate any security.

All you have to do is to rewrite your request parameters to the URL, so that the application which recieves it can access them. I am still not sure what to do if you have documents to send.


Yea, that would be nice but I get a ...
The following errors have occurred.
(92) The gateway no longer supports the requested method of integration.
when I try to add parameters to the URL. It only supports post and I dont think it is possible to forward a post request to anything other then your own server with servlets...

Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
It is possible to post to a URL from a servlet, it's just not a standard part of the servlets API. Take a look at Jakarta Commons HttpClient. You'll find the HttpClient and PostMethod classes particularly useful.

Jules
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Weird Servlet Error
 
Similar Threads
URL and Socket objects from IP address
Socket Create question
Forwarding A Servlet Response in the URL
Struts1.3 tiles problem
HTTPS POST using java.net