Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect expecting the wrong file  RSS feed

 
Alan Yap
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider this scenario I am in:

I have resin 2.1.14 + J2SDK1.4.0 in my development machine and the following scenario works fine:

I have a webapp "nc2" containing 2 files: index.jsp and _main.jsp

index.jsp contains the following code:



When I uploaded these into the hosting, a "file not found" error occured when I open index.jsp. From the error, seems that it is expecting "nc2_main.jsp" as the destination, which is obvious NOT what I want.

I have the privilege in my hosting to tweak the resin.conf file inside. Just wondering if there are certain settings inside that file that I can tweak to solve this problem once and for all.

thanks in advance.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's in your browser's address field after this error occurs?
 
Alan Yap
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
What's in your browser's address field after this error occurs?



sorry for the late reply. Been tinkering with resin.conf with no positive result.

when I open this in the browser > www.mydomain.com/nc2/index.jsp
it suposed to response.sendRedirect("_main.jsp");

but I get this instead:

the address bar show: http://www.mydomain.com/nc2_main.jsp
and the error page is..

404 Not Found
/nc2_main.jsp was not found on this server.

--------------------------------------------------------------------------------
Resin/3.1.2
[ October 09, 2007: Message edited by: Alan Yap ]
 
Alan Yap
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here's the latest update..

After some resin.conf tweaking, now the resulting page looks like this:

address bar shows: http://www.mydomain.com:10050/nc2/_mainf.jsp

the browser (IE6) shows a standard error page below:

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.

--------------------------------------------------------------------------------
 
Akshay Kiran
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for my ignorance- but is Resin J2EE compliant?
I browsed through their site but see no mention of J2EE compliance.
So much help might not come from people who have NOT used it.
What I'm guessing is, maybe you've committed the response before you do the redirect? and resin doesn't have a standard way of handling this?
or maybe it's with the naming conventions?
why don't you try naming it main.jsp and then redirect?
did you check the server logs? maybe it has logged an exception that you've missed?
play around, you should probably have a solution.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Akshay Kiran:
but is Resin J2EE compliant?
Yes.
 
Alan Yap
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
latest update...

I found out everything works FINE with my webapp (redirect and all), as long as the URL has the port number inside. for eg:

www.mydomain.com:10050/mywebapp1
www.mydomain.com:10050/mywebapp2


so all the jsp files inside mywebapp1 mywebapp2 ran properly, response.sendRedirect()works as it should. But I need to get rid of the "10050".

Anyone experienced similar issues like mine?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
10050? That's an odd port. Why are you not using the resin default of 8080? Or why have you not mapped it to the usual 80?
 
Akshay Kiran
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you map it to port 80, you won't need to use the port number as port 80 is the default port for the http requests.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!