aaaaaa
asked on
session probluem
when i use email to open my web
<form action="http://localhost/mmmm.jsp" method=post>
<input type=submit value="GO"/>
</form>
in mmmm.jsp i set:
session.setAttribute("aaa" ,"bbb");
System.out.println("my aaa="+session.getAttribute ("aaa"));
response.sendRedirect("ppp p.jsp");
in pppp.jsp
System.out.println("my aaa="+session.getAttribute ("aaa"));
my result is:
aaa=bbb
aaa=null
why null??
<form action="http://localhost/mmmm.jsp" method=post>
<input type=submit value="GO"/>
</form>
in mmmm.jsp i set:
session.setAttribute("aaa"
System.out.println("my aaa="+session.getAttribute
response.sendRedirect("ppp
in pppp.jsp
System.out.println("my aaa="+session.getAttribute
my result is:
aaa=bbb
aaa=null
why null??
ASKER
the error come out when my pppp.jsp more than 270 line
and this only happen when i open with email!
u know what is mean?
<form action="http://localhost/mmmm.jsp" method=post>
<input type=submit value="GO"/>
</form>
if this is in a *.html, is work fine and i will get my aaa=bbb
but when i open by email, my aaa=null
and this only happen when i open with email!
u know what is mean?
<form action="http://localhost/mmmm.jsp" method=post>
<input type=submit value="GO"/>
</form>
if this is in a *.html, is work fine and i will get my aaa=bbb
but when i open by email, my aaa=null
Even if you do this
mmmm.jsp
------------------
<%
session.setAttribute("aaa" ,"bbb");
out.print("my mmmm.jsp aaa="+session.getAttribute ("aaa"));
System.out.println( "my mmmm.jsp aaa="+session.getAttribute ("aaa") ) ;
response.sendRedirect("ppp p.jsp");
%>
pppp.jsp
------------------
<%
out.print("in pppp.jsp my aaa="+session.getAttribute ("aaa"));
System.out.println( "in pppp.jsp my aaa="+session.getAttribute ("aaa") ) ;
%>
pppp.jsp outputs this in the browser
------------
in pppp.jsp my aaa=bbb
and the tomcat log output is
------------
my mmmm.jsp aaa=bbb
in pppp.jsp my aaa=bbb
Which shows that both work as they should...
mmmm.jsp
------------------
<%
session.setAttribute("aaa"
out.print("my mmmm.jsp aaa="+session.getAttribute
System.out.println( "my mmmm.jsp aaa="+session.getAttribute
response.sendRedirect("ppp
%>
pppp.jsp
------------------
<%
out.print("in pppp.jsp my aaa="+session.getAttribute
System.out.println( "in pppp.jsp my aaa="+session.getAttribute
%>
pppp.jsp outputs this in the browser
------------
in pppp.jsp my aaa=bbb
and the tomcat log output is
------------
my mmmm.jsp aaa=bbb
in pppp.jsp my aaa=bbb
Which shows that both work as they should...
ASKER
same i got null.
u know what i need to do?
i try to access my web click my a email.
please the notice is 'EMAIL'.
is working fine if i click from anyjfdkljfla.html
u know what i need to do?
i try to access my web click my a email.
please the notice is 'EMAIL'.
is working fine if i click from anyjfdkljfla.html
>> the error come out when my pppp.jsp more than 270 line
>>and this only happen when i open with email!
>>u know what is mean?
Sorry no. Could you explain a little more please? How do you "open with email"
>>and this only happen when i open with email!
>>u know what is mean?
Sorry no. Could you explain a little more please? How do you "open with email"
I notice your form action is "http://localhost/mmmm.jsp". So you are working in the root directory and have changed the tomcat port to 80, is that correct?
ASKER
my testing.html
************************** **
<form action="http://localhost/mmmm.jsp" method=post>
<input type=submit value="GO"/>
</form>
************************** **
when i click 'GO', it point to http://localhost/mmmm.jsp, then redirect to
http://localhost/pppp.jsp, then show value: my aaa=bbb
__________________________ __________ __________ __________ ____
in my email.
************************** ***
<form action="http://localhost/mmmm.jsp" method=post>
<input type=submit value="GO"/>
</form>
************************** ****
when i click 'GO', it point to http://localhost/mmmm.jsp, then redirect to
http://localhost/pppp.jsp, then show value: my aaa=null
**************************
<form action="http://localhost/mmmm.jsp" method=post>
<input type=submit value="GO"/>
</form>
**************************
when i click 'GO', it point to http://localhost/mmmm.jsp, then redirect to
http://localhost/pppp.jsp, then show value: my aaa=bbb
__________________________
in my email.
**************************
<form action="http://localhost/mmmm.jsp" method=post>
<input type=submit value="GO"/>
</form>
**************************
when i click 'GO', it point to http://localhost/mmmm.jsp, then redirect to
http://localhost/pppp.jsp, then show value: my aaa=null
ASKER
in my http://localhost/pppp.jsp page
************************** ********** **
<%
out.print("my aaa="+session.getAttribute ("aaa"));
...
....
...
..
.. totally 270 line here
%>
i look my extra 269 line i s no probluem.
but dun know why if open my html it work fine, but open my email cannot
**************************
<%
out.print("my aaa="+session.getAttribute
...
....
...
..
.. totally 270 line here
%>
i look my extra 269 line i s no probluem.
but dun know why if open my html it work fine, but open my email cannot
Try this in mmmm.jsp:
<%
session.setAttribute("aaa" ,"bbb");
out.print("my mmmm.jsp aaa="+session.getAttribute ("aaa"));
System.out.println( "my mmmm.jsp aaa="+session.getAttribute ("aaa") ) ;
RequestDispatcher rd = request.getRequestDispatch er("pppp.j sp");
rd.forward(request, response) ;
%>
<%
session.setAttribute("aaa"
out.print("my mmmm.jsp aaa="+session.getAttribute
System.out.println( "my mmmm.jsp aaa="+session.getAttribute
RequestDispatcher rd = request.getRequestDispatch
rd.forward(request, response) ;
%>
ASKER
summary:
1)open by html, with pppp.jsp line 270
fine
2)open by email, with pppp.jsp line 270
null
3)open by html, with pppp.jsp line 1
fine
4)open by email. with pppp.jsp line 1
fine also
1)open by html, with pppp.jsp line 270
fine
2)open by email, with pppp.jsp line 270
null
3)open by html, with pppp.jsp line 1
fine
4)open by email. with pppp.jsp line 1
fine also
ASKER
my mmm.jsp aaa=bbb
org.apache.jasper.runtime. jspfactory impl internalgetpagecontext
sereve: exception initializing page context
java.lang.stackoverflowerr or
org.apache.jasper.runtime.
sereve: exception initializing page context
java.lang.stackoverflowerr
Just to be clear, when you say open with email, do you mean open with web-based email like hotmail or opened with an email client like Outlook?
The 270 line problem may be the fact that compiled JSPs cannot be larger than 64K. This is because javac does not allow a single method to be larger than 64K and JSPs can be considered to be just on large method. But that should be caught on compilation. It can be worked around by breaking the page up into smaller subsections and using jsp:include to build a single bigger page.
The 270 line problem may be the fact that compiled JSPs cannot be larger than 64K. This is because javac does not allow a single method to be larger than 64K and JSPs can be considered to be just on large method. But that should be caught on compilation. It can be worked around by breaking the page up into smaller subsections and using jsp:include to build a single bigger page.
ASKER
i open with outlook
>>org.apache.jasper.runtim e.jspfacto ryimpl internalgetpagecontext
This happens when the server can't get the session from the request
Try adding <%@ page session="true" %> to the top of mmmm.jsp
Just to be clear, when you say open with email, do you mean open with web-based email like hotmail or opened with an email client like Outlook?
The 270 line problem may be the fact that compiled JSPs cannot be larger than 64K. This is because javac does not allow a single method to be larger than 64K and JSPs can be considered to be just on large method. But that should be caught on compilation. It can be worked around by breaking the page up into smaller subsections and using jsp:include to build a single bigger page.
This happens when the server can't get the session from the request
Try adding <%@ page session="true" %> to the top of mmmm.jsp
Just to be clear, when you say open with email, do you mean open with web-based email like hotmail or opened with an email client like Outlook?
The 270 line problem may be the fact that compiled JSPs cannot be larger than 64K. This is because javac does not allow a single method to be larger than 64K and JSPs can be considered to be just on large method. But that should be caught on compilation. It can be worked around by breaking the page up into smaller subsections and using jsp:include to build a single bigger page.
ASKER
i open with outlook
Does it work okay when you use a browser like Internet Explorer or Firedfox?
ASKER
oh thanks, this work
<%@ page session="true" %>
very thankyou, but can u explain why?
<%@ page session="true" %>
very thankyou, but can u explain why?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This:
mmmm.jsp
<%
session.setAttribute("aaa"
out.print("my mmmm.jsp aaa="+session.getAttribute
response.sendRedirect("ppp
%>
pppp.jsp
-----------
<%
out.print("my aaa="+session.getAttribute
%>
prints
--------
my aaa=bbb
which shows it works. What's the error?