This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Control Flow : 1)Once I access my webapplication through a browser it goes to the index.jsp 2)I had just forwarded that using sendRedirect to file1.jsp. 3)In file1.jsp i will enter username,password & click the submit button. 4)which will transfer the control to the servlet serv.java
Upto this step everything works fine.
Now inside my servlet I will generate a dynamic html page and save that to a folder named "output" please consider file2.html is one such html file which uses the "prop.css" & "validation.js" for broswer display & script validation
Now when i use either of the follwoing two lines inside my servlet
Pls. note i had check all the path verification when i included the .css & .js file in my html AND another point to mention here is when i open the html file manually using the browser it displays everything perfectly.
I had not set any headers to my HttpResponse....
Let me know what basic knowledge i'am missing out here.
Thanks in advance
[BSouther: Added UBB Code tags to directory tree] [ December 07, 2006: Message edited by: Ben Souther ]
You are probably using page-relative addressing in the URLs for your images and style sheets. This is problematic in web applications. You should be using server-relative addressing that begins with the context path.
Because a redirect comes from the browser and the URL known to the browser is the HTML page. In a forward, the URL known to the browser is the servlet URL and it has no knowledge that you've forwarded to an HTML page.
It's best to just always use server-relative addressing for image, CSS and script files. Such references will always work regardless of how the page was displayed.
Joined: Sep 19, 2005
Exactly said Bear Bibeault, thanks for the reply. i got that fixed.