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


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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: 56202
    
  13

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 ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2552
    
    2

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
 
Similar Threads
jsp -> Servlet -> jsp
kean 2 know design patten
interpreting javascript with RESTful servlet
Retrieving data from a servlet then forward to JSP page
jQuery getJSON question