aspose file tools*
The moose likes Servlets and the fly likes including .js file in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "including .js file in JSP" Watch "including .js file in JSP" New topic
Author

including .js file in JSP

pritam sabnis
Greenhorn

Joined: Dec 27, 2007
Posts: 6
I am developing one application using JSP and Servlet.
To include menu in my application i am using .js(javascript) files.
When I am forwarding request from servlet to JSP using forward method of request dispatcher i am unable to display the menu,but when i am using sendRedirect() method it is working fine.
Can anyone help in this issue?


Thanks and regards,

Pritam Sabnis
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61421
    
  67

Most likely you are using page-relative addressing for your JavaScript file, and that's not going to work in general.

See the ResourceUrlProblems entry of the JSP FAQ. Always be sure to check the FAQs first to see if your question has already been addressed.
[ August 02, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Hi pritam sabnis welcome to Javaranch ,
looks like Bear has provided your required answer.
Please take some time to read the ask good questions link below.


SCJP, SCWCD.
|Asking Good Questions|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: including .js file in JSP