Resolved!

I apologize to everyone for taking a while to respond. It was a busy weekend and I was not at
the computer. Thank you all for the responses.

I read your emails about a half hour ago and ran my application to get fresh log files and to check them all. Sure enough in the log file, 'localhost.2014-12-08.log', I found an error message about the java code in my 's.jsp' file. I fixed the error and all is well now. I thought that I looked at this file the other day before sending in my question to the mailing list and I did not see the error messages then. I am going to guess that I am in error and the I did not actually look at the file, although I know I looked at most of the log files in the tomcat/logs directory.

I was curious why the error did not show up in my firefox browser console, so I removed my fix and re-ran my application with the error in it. Sure enough, the error did not show up on the console.

One thing I am going to do, before going back to my main stream work is write up a document for myself on how to debug my current environment. When done, I will share it with this mailing list since it may be useful to others and others my want to contribute addtions.

Jim A.



On 12/06/2014 04:19 PM, Jim Anderson wrote:

Hi to all,

I am currently developing some server side JSP code. By and large, things are progressing and working well. I have gotten half way decent at debugging my java/javascript/jquery/jsp/HTML source code, but I have run into a problem in JSP where the code does not work, but I have found no clues as to why it is not working.

The environment that I am working in is Tomcat 7.0.54 and I am using java 1.8 and jquery 1.7.2.

What I am trying to do:

I have html code with an embedded javascript that runs jquery code. The jquery code being run makes an ajax call to a JSP file on the server side, which I will call s.jsp. This file is a very simple file whose sole function is to take a registration name and query an SQL database to see if the name has already been used at the web site. The registration name is passed with a method call that looks like this:

        regName = request.getParameter("registrationName"); [item 1]

This all works fine for me. So far so good. If the registration name is good, the state of my application logic changes. I guess there are multiple ways to store state, but I have chosen to store the state as a session variable. I searched the net and found an example of JSP code that uses the session object to store information as an attribute with a statement that looks something like:

        session.setAttribute("logicState","nameValidated"); [item 2]

I tried adding this line and when I now push the submit button of my HTML form, which calls s.jsp as an action, the application hangs (in firefox). I receive no error messages anywhere. Usually, when I add bad code in s.jsp I will get a stacktrace from firefox or error messages in the firefox debug console, or both. Or I will error message in my own homegrown debug code, but that does not happen. I know that my home grown code does not get called, so I can infer that the call to s.jsp is never made, but I cannot be 100% certain of this. I also checked my tomcat/logs directory and there was nothing in the log files that I would not expect.

So my first question is: Can I simply add item 2, above, to my jsp file and expect that tomcat will recognize that I am referencing the session object? In s.jsp, item 1, above, references the request object and tomcat handles that and I am expecting that it will also hand my reference to the session object.

My second question is more general. My code is not working and there are no error messages. Can anyone speculate why this would be the case? Is there any place else I should be looking for error messages?

Jim A.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to