• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

response.sendRedirect expecting the wrong file

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

--------------------------------------------------------------------------------
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic