You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Anderson <ji...@centurylink.net> on 2014/12/06 22:19:10 UTC

My problem: I cannot successfully get or set a session attribute from a JSP file.

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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by Kiran Badi <ki...@poonam.org>.
I agree with Terence check if request is indeed getting fire. Add couple of
alerts to jquery call. You can also check if value is getting added to
session via tomcat manager admin interface , I remember there is option to
see session values /attributes over there.

On Monday, December 8, 2014, Terence M. Bandoian <te...@tmbsw.com> wrote:

> On 12/6/2014 3: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.
>>
>>
>
> Hi, Jim-
>
> You should be able to see in Firebug or the Network tab of the Firefox
> developer's tools whether or not the request was actually sent by the
> browser.
>
> -Terence Bandoian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
On 12/6/2014 3: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.
>


Hi, Jim-

You should be able to see in Firebug or the Network tab of the Firefox 
developer's tools whether or not the request was actually sent by the 
browser.

-Terence Bandoian


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


Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by Ameer Mawia <am...@gmail.com>.
On Sun, Dec 7, 2014 at 2:49 AM, Jim Anderson <ji...@centurylink.net>
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.
>
> This should work. Make sure, you don't have the session disable on your
jsp i.e. your jsp don't have this directive:
<%@ page *session*="false" %>


> 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?
>
> There are many places to start debugging at. But first and foremost is
your application logs. What does your application logs says? Any exception,
corresponding stack-trace??

> Jim A.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-12-07 0:19 GMT+03:00 Jim Anderson <ji...@centurylink.net>:
>
> 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?
>


1. Is this reproducible if you restart Tomcat?

2. Is there anything in your access log? Was your request received by Tomcat?

http://wiki.apache.org/tomcat/FAQ/Troubleshooting_and_Diagnostics

Best regards,
Konstantin Kolinko

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


Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by Jim Anderson <ji...@centurylink.net>.
Please make note that I do not see errors in the brower window, but in 
the brower console window.
If I have time later, I will create an error in my 's.jsp' server code 
and verify that an error is
reported in the console.

Jim A.

On 12/08/2014 04:17 PM, David kerber wrote:
> On 12/8/2014 4:04 PM, Jim Anderson wrote:
>>
>> David,
>>
>> I have to question your response. In the past, I have made errors in the
>> serverside JSP file and the console has identified errors for me to the
>> point were I have become dependent this feedback.
>>
>> I understand the separation of the client side vs the server side,
>> (and I must confess that sometimes in the middle of debugging, I forget
>> that it is there),
>> but my assumption has been that when the JSP code is compiled by the
>> tomcat environment, it gets sent errors back through the Firefox API
>> that allows the errors to  be displayed in the console.
>>
>> I don't know the Firefox API, but I can believe it has hooks in the
>> brower code that allows an application such as Tomcat to post
>> information into the console. If fact, I would expect the browser
>> console to have that kind of hook.
>
> Hmm, I've never seen anything like that.  The only time I see server 
> errors in the browser is when the server sends them as part of its 
> HTTP response.  If the error output is swallowed on the server end and 
> never makes it to the browser, the browser does not display anything.
>
> I could certainly be missing something here, though...
>
>
>>
>> Jim
>>
>>
>> On 12/08/2014 03:54 PM, David kerber wrote:
>>> On 12/8/2014 3:49 PM, Jim Anderson wrote:
>>>>
>>>> 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.
>>>
>>> The reason it doesn't show up in your browser is that it's happening
>>> on the server, not the client.  So the browser never knows that there
>>> is an error.
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by David kerber <dc...@verizon.net>.
On 12/8/2014 4:04 PM, Jim Anderson wrote:
>
> David,
>
> I have to question your response. In the past, I have made errors in the
> serverside JSP file and the console has identified errors for me to the
> point were I have become dependent this feedback.
>
> I understand the separation of the client side vs the server side,
> (and I must confess that sometimes in the middle of debugging, I forget
> that it is there),
> but my assumption has been that when the JSP code is compiled by the
> tomcat environment, it gets sent errors back through the Firefox API
> that allows the errors to  be displayed in the console.
>
> I don't know the Firefox API, but I can believe it has hooks in the
> brower code that allows an application such as Tomcat to post
> information into the console. If fact, I would expect the browser
> console to have that kind of hook.

Hmm, I've never seen anything like that.  The only time I see server 
errors in the browser is when the server sends them as part of its HTTP 
response.  If the error output is swallowed on the server end and never 
makes it to the browser, the browser does not display anything.

I could certainly be missing something here, though...


>
> Jim
>
>
> On 12/08/2014 03:54 PM, David kerber wrote:
>> On 12/8/2014 3:49 PM, Jim Anderson wrote:
>>>
>>> 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.
>>
>> The reason it doesn't show up in your browser is that it's happening
>> on the server, not the client.  So the browser never knows that there
>> is an error.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by Jim Anderson <ji...@centurylink.net>.
David,

I have to question your response. In the past, I have made errors in the 
serverside JSP file and the console has identified errors for me to the 
point were I have become dependent this feedback.

I understand the separation of the client side vs the server side,
(and I must confess that sometimes in the middle of debugging, I forget 
that it is there),
but my assumption has been that when the JSP code is compiled by the 
tomcat environment, it gets sent errors back through the Firefox API 
that allows the errors to  be displayed in the console.

I don't know the Firefox API, but I can believe it has hooks in the 
brower code that allows an application such as Tomcat to post 
information into the console. If fact, I would expect the browser 
console to have that kind of hook.

Jim


On 12/08/2014 03:54 PM, David kerber wrote:
> On 12/8/2014 3:49 PM, Jim Anderson wrote:
>>
>> 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.
>
> The reason it doesn't show up in your browser is that it's happening 
> on the server, not the client.  So the browser never knows that there 
> is an error.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by David kerber <dc...@verizon.net>.
On 12/8/2014 3:49 PM, Jim Anderson wrote:
>
> 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.

The reason it doesn't show up in your browser is that it's happening on 
the server, not the client.  So the browser never knows that there is an 
error.



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


Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

Posted by Jim Anderson <ji...@centurylink.net>.
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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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