• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP links appear to not work,  RSS feed

 
Nick J Barkworth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I relatively new to Servlets and JSP. I've spent the day trying to find out why this is happening.

I have a simple JSP
chooseFramework
in which there is a form which has some data in a list box which is populated at run time. The data appears in the list box with no problems. When I submit the form back to the front controller the browser appends the controllers name again and I can't fathom out why.

So instead of getting : https://localhost:8443/tornado/controller/addElements
Its sending :
https://localhost:8443/tornado/controller/controller/addElements

Which is throwing the front controller !!

I thought it might be something to do with the form, however it does the same with static links.

The bizarre thing is that when I reference the JSP from another JSP through a static link it works fine, it only goes wrong when the front controller dispatches a JSP.

Could anybody help or point me in the right direction?

Thanks

Nick


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66260
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your action is specifying a page-relative URL. That's a no-no. It should be a server-relative URL that begins with the context path.

See this entry in the JSP FAQ.
[ October 31, 2007: Message edited by: Bear Bibeault ]
 
Nick J Barkworth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much.

For the record I changed the Action to read



and it works.

Thanks again I appreciate your help.

Nick
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66260
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My pleasure. Welcome to the Ranch!
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!