aspose file tools*
The moose likes Servlets and the fly likes Servlet - Urgent help required. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet - Urgent help required." Watch "Servlet - Urgent help required." New topic
Author

Servlet - Urgent help required.

Hutton Chris
Greenhorn

Joined: Jun 04, 2003
Posts: 7
Hello,
we have a new application that is deployed in Tomcat server 4.0.
We have used Frames. The problem is, after submitting the JSP form, we get the target JSP correctly. But the I.E browser progress bar (at the bottom of internet explorer browser) still displays the progress as though something is still being downloaded.
We tried deploying the application in BEA weblogic also. Still we see the same problem.
Is it because of using Frames?
Any suggestions?


Thanks,<br />Chris Hutton<br />SCJP2
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
I doubt that it is caused by the use of the frameset. Basically the browser doesn't believe that it has been passed enough bytes as set by the setContentLength() method on the servlet. I have seen this happen on a clients site on pages that were being served over HTTPS (basically the size of the page was always 1 byte small than expected) and so the browser keeps expecting info until the request eventually times out.
I have never seen it happen on servlets generated from JSPs. On the servlets I eventually resolved the problem by simply removing the line of code that called the setContentLength() method.
HTH


Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
Hutton Chris
Greenhorn

Joined: Jun 04, 2003
Posts: 7
Andy,
Thanks for your reply.
In fact our JSP page (FORM) invokes a Servlet and when servlet returns the target JSP page, we see the problem that I mentioned earlier.
There is no code in our servlet that checks for content length.
Any suggestions?
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
Here is a snippet of code from the end of one of my servlets to show the order in which I set the details on the response:


Can you post the code in your servlet to this forum so that I can have a look at what you are doing. It could be as simple as not setting the status on the response.
HTH
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
You might see this if your servlet is not closing the output stream.
Bill
Hutton Chris
Greenhorn

Joined: Jun 04, 2003
Posts: 7
Bill and Andy,
Thanks for your reply.
Here is the code we use.
public class AdminServlet extends HttpServlet
{
HttpSession session = null;
public AdminServlet()
{
}

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
doPost(request,response);
}

public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
String action=null;
String url=null;
session=req.getSession(true);
try
{
if(req.getParameter("actionName") != null)
{
action = req.getParameter("actionName");
}

if("ENQUIRY".equals(action))
{
req=createRecord(req,resp);
url="/userinterface/a.jsp";
}
if("REVIEW".equals(action))
{
req=updateStatus(req,resp);
url="/userinterface/b.jsp";
}
}
catch(Exception e)
{
req.setAttribute("message","Server Maintenance : Please try after some time");
}
finally
{
getServletContext().getRequestDispatcher(
resp.encodeURL(url)).forward(req,resp);
}
}
We do not use ServletOutputStream.
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
Maybe you should post your jsp page. Probably the problem is in there somewhere.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet - Urgent help required.