Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Placing images appropriately  RSS feed

 
anees ahamed
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts,
This( http://docs.google.com/View?id=dfzrknk_74hk85dhcn ) is the directory structure of my application.

JSP's are inside the folder HRMS, Images inside images, Servlets inside WEB-INF/classes/Server

I have a small issue.

The images and css are getting loaded perfectly in the JSP's.

<link rel="stylesheet" href="../css/mystyle.css" type="text/css" />



This is how I load them in the JSP's.

My problem is that, I submit a JSP to a servlet; ie; hrms_user_login.jsp will be submitted to hrms_user_login.java . If it is a valid user, he will be forwarded to hrms_defult.jsp, from the servlet using rd.forward.

Now, comes the problem, images are not displayed and css is not applied to the default.jsp page this time even though I have included them as described above for hrms_user_login.jsp.

What can be the reason? How can I overcome this?

Regards,
Anees


Why does this happen
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page-relative URLs are a no-no.

See the JSP FAQ for info on proper resource URLs.
 
anees ahamed
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot.
That FAQ section was very informative, I understood the concept and solved the problem.

Since, I have explained my question in detail here, I would like to clarify one more doubt. If possible, kindly give some hint.

1) I submit the hrms_user_login.jsp -> It gets submitted to a servlet -> From servlet it goes to default.jsp

The url's displayed in browser in this case

Before submitting

http://localhost:8080/WebContent/HRMS/hrms_user_login.jsp

After submitting

http://localhost:8080/WebContent/server.hrms_user_login

Is there any way by which I can replace "server.hrms_user_login" portion in the url with something else?



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Why would you want to?

By the way, it's best to ask new questions in new topics. Now this question is buried in a topic with a subject that has nothing to do with it.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!