Without looking too carefully at everything, I'd just suggest a couple of
classic debugging steps:

1) first, you say the problem occurs when going from the one page to the
other. Since the "other" is reached via an href, what happens when you just
run it (the addnews program) on its own (typing the URL in your browser)? Is
it also not responding? It's useful to try to isolate the nature of the
problem.

2) In either case, try removing things in the addnews template to get it to
run (like take out the includes and the taglib directives, since right now
it doesn't appear they're doing anything important to the other tags on that
page). Then add things back and refresh the page until it hangs, then you've
got your culprit.

3) Of course, since you're setting session variables in one and accessing
them in another, there could be more to what's going on that may respond
differently when indeed you've run the controls template first. But try it
several ways (run addnews on its own when there's no session variable, run
it after running controls). If you can restart the Jrun server to clear the
session variables between attempts that could be useful too.

4) Finally, when you say it "doesn't respond", beware that the problem could
simply be that the HTML being sent to the browser isn't properly formed.
I've seen plenty of blank pages on web site caused by a missing closing tag
(which might be forgiven by one browser but totally blank out the page in
another browser--and it goes both ways between what netscape and IE will
choke on). So do a "view source" on the page that's not responding, if
indeed you can, to see what's been generated. Maybe the problem is in the
header, footer, or main.

/charlie

-----Original Message-----
From: Darren Labrum [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 03, 2001 4:08 PM
To: JRun-Talk
Subject: .jsp page hangs when trying to access.


I am starting to develop a very simple application.  However, this "simple"
application is giving me some trouble.  I am just starting out with JRun and
would like to know if what is happening to me has something to do with JRun,
my code, etc.

When going from the controls.jsp page to the addnews.jsp page it hangs and
won't even access the addnews.jsp page.

Here is the code for the controls.jsp and addnews.jsp...  Very simple, just
need to know if there is a no no in there somewhere:

----controls.jsp----

<%@ page import="javax.naming.*" %>
<%@ page import="allaire.taglib.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ taglib uri="jruntags" prefix="jrun" %>


<%! String PageName =  "Administration"; %>
<%@ include file="/header.jsp"%>
<%@ include file="/main.jsp"%>

<% String checkname = request.getParameter("username");
   String checkpass = request.getParameter("password");
%>

<jrun:sql datasrc="ivjsp" id="CheckUser">
        SELECT * FROM admin
        WHERE username = '<%= checkname %>'
          AND password = '<%= checkpass %>'
</jrun:sql>

<jrun:param id="CheckUser" type="QueryTable"/>

<% if (CheckUser.getRowCount() ==1) { %>

<%
        session.setAttribute("uname", checkname);
        out.println("The session username is " + checkname);
%>

<table>
 <tr>
  <td><a href="addnews.jsp">Add news article</a></td>
 </tr>
</table>

<% } else { %>

<table>
 <tr>
  <td>Try your login again, something is wrong with either your username or
password)</td>
 </tr>
</table>

<% } %>

<%@ include file="/footer.jsp"%>


-----------------

As you can see the controls.jsp page is very simple.

Here is the template that hangs and will not access


----  addnews.jsp ----

<%@ page import="allaire.taglib.*,java.util.Date" %>
<%@ taglib uri="jruntags" prefix="jrun" %>

<%! String PageName =  "Administration"; %>
<%@ include file="/header.jsp"%>
<%@ include file="/main.jsp"%>

<%
        String checkname = (String) session.getAttribute("uname");
        out.println("The session user is " + checkname);
%>

<% if (checkname != null) {%>

<table cellpadding="2" cellspacing="0" border="0" align="center">
  <tr>
    <td>
      <div align="right">This is the news area.</div>
    </td>
    <td></td>
  </tr>
</table>

<% } else { %>
        Placeholder something goes here.
<% } %>

<%@ include file="/footer.jsp"%>

----------------


Again, it hangs when I try to access the addnews.jsp page.  Is there
something I am doing in the code to cause this to happen?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to