• 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

Placing images appropriately

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
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
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.
 
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic