JSP Session Problems

Hi, i am facing a problem of the Object set into a session not being visible to the others pages. what did i done wrongly?
here is the code:
in login.jsp (currently hardcode cos i haven recieve that part):
<%@page import="fantasy.team.*,java.util.Vector" session="true"%>
<%
Team t = new Team("Kacheek FC");
session.setAttribute("team",t);
if( session.getAttribute("team") ==null){
     out.write("how come null");
}else{
     out.write("not null");
%>
Select
//End of coding
not null will be printed
Following code belong to selectPlayer.jsp:
if( session.getAttribute("team") == null){          
          out.write("i am null");               }else{
          out.write("i am not null");
i am null is printed
what is wrong with my coding?
thanks.

i do a
if(session.isNew())
out.write("New");
and the result is new.
meaning that my session is invalidate.
that explain my value from "gone" rite?
how to solve this?
thanks.

Similar Messages

  • BC4J. JSP, session problems

    I would like to store session type information, ie client_id in a session object and be able to retrieve its value from any of my jsp pages.
    Is there a jsp tag or some other JDev component that I should be using?
    TIA

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Danny Gagliardi ([email protected]):
    I would like to store session type information, ie client_id in a session object and be able to retrieve its value from any of my jsp pages.
    Is there a jsp tag or some other JDev component that I should be using?
    TIA<HR></BLOCKQUOTE>
    You could try something like this in your jsp
    <%
    session.setAttribute("clientId", "1234");
    %>
    To get the clientId from the session try
    <%
    String ClientID = (String) session.getAttribute("clientId");
    %>
    Hope this help,
    Kh

  • JSP Session problem in HTML frames????

    Hi everybody;
    I have a problem with session I think. My index page is created with 4 diffrent jsp's in 4 diffrent frames.After a while lets say 15 minutes when my session is expired.When I click one of my button ..The frames which linked with that button is show Http 500 error page.When I refreshes the web page they all gone.(and my web page goes normal again)
    I want to ask you how can I handle this problem.How can I solve this error page showing and stop showing that error page instead of in each frame,to refresh the index page again??
    Thanks for your consideration.....

    The first step is to decide whether 15 minutes is a suitable timeout for sessions.
    If it isn't then simply increase it in web.xml. You may also decide that session persistence is worth enabling (if your Servlet container supports it).
    If it's not then your pages will need to handle a null (or at least new) session slightly more elegantly. You're probably just getting a null pointer exception because something your pages is relying on is missing (a session attribute of some sort). Sometimes it's sufficient just to redirect the topmost window to the index page - not the greatest user experience in the world but at least consistent.
    Hope this helps.

  • Newbie :  JSP session problem after reload with IE refresh button.

    Hi,
    I had an issue with JSP reloading using tomcat 4.* and IE.
    I have a jsp1.jsp is opened in two different IE windows(one by one). Once i refreshed using IE refresh button from the first window, its loaded with second windows session details. Its changess whole http request object with second window.
    Am not sure , why its happening ? Could anybody shed light on this ?
    Thanks and Regards
    PV

    Hello,
    No, am not saving any form details . But i noticed session id is changing completely for the first window once i loads frame on the second window.
    javascript:alert(document.cookie) Above scriptlet (IE address bar) returns session id from the second window rather than current window without refreshing, that means, its removed whole request completely or somehow manipulated previous sessions. Can anybody explain this behaviour ?
    Thanks

  • Jsp session problem when more than one user is loging from the same machine

    Hi everybody,
    I have created a login page and i use to store user name and password using sessions. It is working fine for one user from one machine. But if two or more users logged from the same machine, all the users are getting the same data as of the last user logged in. Also if one user is logged out all user sessions on that machine are expiring (same as previous YAHOO problem).
    i think there is problem with session variables. The user name and password which i am storing in session variables are updating the same variables for all users. I think a seperate set of session variables are not creating for each user login.
    Can any body help me plz....
    regards,
    Prasanth.C

    First, you need to clear any cookies you are setting.
    Second, you need to synchronize some key data fetching blocks in your servlet.
    Third, ensure that you are invalidating a session properly.
    Don't ask me for more details. Google around for information ;)
    Richard.

  • Session problem in jsp application

    I face a session problem. I setting everything in a session and when pass back to a main page, the value is not display in the screen. But after refresh the value will display in the screen and this kind of problem only come out very few time and i dun knw how to solve this...
    Anyone here can give me some idea and suggestion or the way to solve this kind of problem!!!

    define "2 different clients"
    1) You have 2 different PCs and it's using the same session ID for both? I doubt this. I think the server is advanced enough not to use give a session ID that's already been created.
    2) You have 1 PC and are using IE or Netscape and using File > New Window to open a new window and connect again. This you can't fix without using only URL rewriting to manage session, because the different windows will share the same session cookies.

  • JSP session getting destroyed when second user logs in

    Hi,
    I am facing a session related problem in a small login program in jsp. I am using three jsp pages, login.jsp (user logs in), page1.jsp (creates a session and stores username) and page2.jsp (accesses session).
    Login.jsp:
    No jsp actually. Just a simple html form.
    Page1.jsp:
    String name=request.getParameter("Name");
    session=request.getSession(true);
    session.setAttribute("Name",name);
    Page2.jsp:
    session=request.getSession(false);
    if(session.isNew())
    System.out.println("new session created");
    String name=session.getAttribute("Name").toString();
    As expected, it works like session getting set at page1 and used at page2. It works good if users log in one by one. The problem arises when 2 (or more users with different logins) try to access the page at same time. When a new user logs in, the previous user session gets destroyed (session.isNew() becomes true and session Id changes).
    Is it the way I am using sessions (missing something), or there is some setting in tomcat server to specify maximum number of logins (sessions that can be handled).
    Regards
    Kamal

    Hi,
    Thanks for reply, but I guess the problem is not clear. Let me explain..
    A user logs in, he reaches first page (page1.jsp), here session is getting set. Then user goes to page2.jsp where application retrieves the information from session and uses it. It works all well.
    When two (or more) user logs in.. First user logs in, he reaches page 1, session is set. But then another user logs in (different id) and a session is set for him as well. Now the problem here is that session for first user gets destroyed at this point, which is unexpected (two sessions should not conflict, on different machines).
    Additionally, the problem does not happen necessarily at second login. eg. sometimes 4 users log in and when fifth one logs in, fourth gets logged out (session gets destroyed).
    I am not able to figure out, whether the problem is in code (given in first post) or there is some tomcat setting responsible for this behavior.
    Regards
    Kamal

  • Jsp session variable to call in  java class.

    here i am facing a problem in calling a jsp session varibale to java class.
    in my code.. i have seperate files for jsp pages and packaged java classes.
    as i am developing a web tire application. the data entered in the front end i am getting to jsp page and putting the mandatory in session to use in other pages. now here the same session vaiable i have to use/call in java class file.
    Please refer me the best method and any references on this to call the session vaiable to java class file.
    in jsp page i decleared like this:
    session.setAttribute("stuIdentification",stuid);
    this id i have to use in java class.file.
    how to call it?
    Thanks
    Kurra

    Gimbal2's got the right idea.
    The reasons for choosing point 1) are also valid. Whenever possible try and do as much code that is not specifically tied to your business objects inside your dynamic element (the jsp page) instead of your static one (the compiled class)
    this allows you to very easily update your jsp to make any changes without having to recompile class code. Recompiling seems like a little thing when you are in development but imagine if the class is executed by a business critical application that faces forward to customers, recompiling will mean shutting down your servers and that may not be an option.
    Regards,
    David

  • Re: [iPlanet-JATO] sp3 jsp compiler problem

    Weiguo,
    First, Matt is correct, the regular expression tool is perfect for general text
    substitution situations, and as a completely independent tool its use is not
    restricted to migration situations (or file types for that matter).
    Second, I sympathize with the unfortunate trouble you are experiencing due to
    Jasper's (perhaps more strict) compilation, but in what way did the iMT
    automated translation contribute to these inconsistencies that you cited?
    1. Changed the case of the tag attribute to be the same as what's
    defined in tld.
    example: changed OnClick to onClick
    The iMT does not generate any OnClick or onClick clauses per se. In a
    translation situation, the only way "OnClick" would have been introduced was if
    it had been part of the pre-existing project's "extraHTML" (which was written
    by the original customer and just passed through unchanged by the iMT) or if it
    was added manually by the post-migration developer.
    2. Removed attributes which are not defined in tld.
    example: escape attribute only defined in three tags
    but in some pages, it's used although it's not defined as an
    attribute
    of certain tags. The jasper compiler doesn't like it.Can you give soem examples? Is there a definite pattern? Again, this might be
    similar to the OnClick situation described above?
    3. In an end tag, there can't be any space.
    example: </content > doesn't work. </content> works.
    Again, the content tag would never have been generated by the iMT. There was no
    equivalent in the NetDynamics world, so any content tags in your code must have
    been introduced by your developers manually. Its a shame that jasper is so
    particular, but the iMT could not help you out here even if we wanted to. The
    constants that are used by the iMT are defined in
    com.iplanet.moko.jsp.convert.JspConversionConstants. From what I can see, the
    only situation of a closing tag with any space in it is
    public static final String CLOSE_EMPTY_ELEMENT = " />";
    But that should not cause the type of problem you are referring to.
    Mike
    ----- Original Message -----
    From: Matthew Stevens
    Sent: Thursday, September 06, 2001 10:16 AM
    Subject: RE: [iPlanet-JATO] sp3 jsp compiler problem
    Weiguo,
    Others will chime in for sure...I would highly recommend the Regex Tool from
    the iMT 1.1.1 for tackling this type of problem. Mike, Todd and myself have
    posted to the group (even recently) on directions and advantages of creating
    your own RULES (rules file) in XML for arbitary batch processing of source.
    matt
    -----Original Message-----
    From: weiguo.wang@b...
    [mailto:<a href="/group/SunONE-JATO/post?protectID=125056020108194190033029175101192165174144234026000079108238073194105057099246073154180137239239223019162">weiguo.wang@b...</a>]
    Sent: Thursday, September 06, 2001 12:25 PM
    Subject: [iPlanet-JATO] sp3 jsp compiler problem
    Matt/Mike/Todd,
    We are trying to migrate to sp3 right now, but have had a lot of
    issues with the new jasper compiler.
    The following workaround has been employed to solve the issues:
    1. Changed the case of the tag attribute to be the same as what's
    defined in tld.
    example: changed OnClick to onClick
    2. Removed attributes which are not defined in tld.
    example: escape attribute only defined in three tags
    but in some pages, it's used although it's not defined as an
    attribute
    of certain tags. The jasper compiler doesn't like it.
    3. In an end tag, there can't be any space.
    example: </content > doesn't work. </content> works.
    As I see it, we have two options to go about solving this problem:
    1. Write a script which will iterate through all the jsp files and
    call jspc on them. Fix the errors manually when jspc fails. Jspc will
    flag the line number where an error occurs.
    2. Write a utility which scans the jsp files and fix the errors when
    they are encountered. We should define what's an error and how to
    correct it. It's best if we combine this with solution 1 since we
    might miss an error condition.
    Actually, there might be another option, which is seeking help from
    you guys since you have better understanding of JATO and iAS. Can you
    do anything to help us?
    We would be happy to hear your thoughts.
    At last, I would like to suggest modifying the moko tool so that
    these rules are enforced and the generated JSPs work with the new
    compiler. This is for the benefit of any new migration projects.
    Thanks a lot.
    Weiguo
    [email protected]
    Choose from 1000s of job listings!
    [email protected]
    [Non-text portions of this message have been removed]

    Thanks a lot Matt and Mike for your prompt replies.
    I agree completely that iMT doesn't introduce the inconsistencies.
    About the three cases I mentioned, the third one happens only in
    manually created JSPs. So it has nothing to do with iMT. The first
    two are mainly due to the existing HTML code, as you rightly pointed
    out.
    The reason I made the suggestion is since we know that case 1 and 2
    won't pass the japser compiler in sp3, we have to do something about
    it. The best place to do this, in my mind, is iMT. Of course, there
    might be some twists that make it impossible or difficult to do this
    kind of case manipulation or attribute discard.
    Weiguo
    --- In iPlanet-JATO@y..., "Mike Frisino" <Michael.Frisino@S...> wrote:
    Weiguo,
    First, Matt is correct, the regular expression tool is perfect for general text substitution situations, and as a completely independent
    tool its use is not restricted to migration situations (or file types
    for that matter).
    >
    Second, I sympathize with the unfortunate trouble you are experiencing due to Jasper's (perhaps more strict) compilation, but
    in what way did the iMT automated translation contribute to these
    inconsistencies that you cited?
    >
    1. Changed the case of the tag attribute to be the same as what's
    defined in tld.
    example: changed OnClick to onClick
    The iMT does not generate any OnClick or onClick clauses per se. In a translation situation, the only way "OnClick" would have been
    introduced was if it had been part of the pre-existing
    project's "extraHTML" (which was written by the original customer and
    just passed through unchanged by the iMT) or if it was added manually
    by the post-migration developer.
    >
    2. Removed attributes which are not defined in tld.
    example: escape attribute only defined in three tags
    but in some pages, it's used although it's not defined as an
    attribute
    of certain tags. The jasper compiler doesn't like it.Can you give soem examples? Is there a definite pattern? Again, this might be similar to the OnClick situation described above?
    >
    >
    3. In an end tag, there can't be any space.
    example: </content > doesn't work. </content> works.
    Again, the content tag would never have been generated by the iMT. There was no equivalent in the NetDynamics world, so any content tags
    in your code must have been introduced by your developers manually.
    Its a shame that jasper is so particular, but the iMT could not help
    you out here even if we wanted to. The constants that are used by the
    iMT are defined in
    com.iplanet.moko.jsp.convert.JspConversionConstants. From what I can
    see, the only situation of a closing tag with any space in it is
    public static final String CLOSE_EMPTY_ELEMENT = " />";
    But that should not cause the type of problem you are referring to.
    Mike
    ----- Original Message -----
    From: Matthew Stevens
    Sent: Thursday, September 06, 2001 10:16 AM
    Subject: RE: [iPlanet-JATO] sp3 jsp compiler problem
    Weiguo,
    Others will chime in for sure...I would highly recommend the Regex Tool from
    the iMT 1.1.1 for tackling this type of problem. Mike, Todd and myself have
    posted to the group (even recently) on directions and advantages of creating
    your own RULES (rules file) in XML for arbitary batch processing of source.
    >
    matt
    -----Original Message-----
    From: weiguo.wang@b...
    [mailto:<a href="/group/SunONE-JATO/post?protectID=125056020108194190033029175101192165174048139046">weiguo.wang@b...</a>]
    Sent: Thursday, September 06, 2001 12:25 PM
    Subject: [iPlanet-JATO] sp3 jsp compiler problem
    Matt/Mike/Todd,
    We are trying to migrate to sp3 right now, but have had a lot of
    issues with the new jasper compiler.
    The following workaround has been employed to solve the issues:
    1. Changed the case of the tag attribute to be the same as
    what's
    defined in tld.
    example: changed OnClick to onClick
    2. Removed attributes which are not defined in tld.
    example: escape attribute only defined in three tags
    but in some pages, it's used although it's not defined as an
    attribute
    of certain tags. The jasper compiler doesn't like it.
    3. In an end tag, there can't be any space.
    example: </content > doesn't work. </content> works.
    As I see it, we have two options to go about solving this problem:
    >>
    1. Write a script which will iterate through all the jsp files and
    call jspc on them. Fix the errors manually when jspc fails. Jspc will
    flag the line number where an error occurs.
    2. Write a utility which scans the jsp files and fix the errors when
    they are encountered. We should define what's an error and how to
    correct it. It's best if we combine this with solution 1 since we
    might miss an error condition.
    Actually, there might be another option, which is seeking help from
    you guys since you have better understanding of JATO and iAS. Can you
    do anything to help us?
    We would be happy to hear your thoughts.
    At last, I would like to suggest modifying the moko tool so that
    these rules are enforced and the generated JSPs work with the new
    compiler. This is for the benefit of any new migration projects.
    Thanks a lot.
    Weiguo
    [email protected]
    Choose from 1000s of job listings!
    [email protected]
    Service.
    >
    >
    >
    [Non-text portions of this message have been removed]

  • How to store jsp session data of different user in util.hashmap

    how to store jsp session data of different user in java.util.hashmap
    and access the data of all user on the server side
    The same example is given in professional jsp but its not working.
    I can use getIds() of httpsessioncontext but it's depricated

    Hi
    I'm trying to make an example.
    With the following codes you can get the date from the session.
    request.getSession().getAttribute("sessionname")
    To store it in a hashmap you could do it like this ->
    Hashmap hm = new Hashmap();
    hm.put(Object key, request.getSession().getAttribute("sessionname"));
    I hope you understand it if not just write it!
    Cyrill

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Help with jsp session validation

    i've build up a page that only users wil 'administrator' as the session is variable can access. if they don't they will be directed to the login page.
    However, I'm getting a null pointer exception.
    my code is as follows:
    <%@ page import="java.io.*"%>
    <%
         if (session.getAttribute("id").equals(null) || !(session.getAttribute("id").equals("administrator")))
              response.sendRedirect("adminlogin.htm");
    %>
    Error Message:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
    root cause
    java.lang.NullPointerException
    any pros please help? i know it's something to do with my jsp session validation. thanks in advance.

    one more thing, with regrads to the solution evnafets provided. I tried it out on all my pages that requires administrator rights and found that the code only redirects when it's not expecting any parameters. Else, it just display an error message there. Is there a way around this? Or I should let let my end user suffer?
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:534)
    root cause
    java.lang.NullPointerException
         at org.apache.jsp.view_jsp._jspService(view_jsp.java:177)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:534)

  • Jsp session variable in javascript

    hi,
    i want use a jsp session variable inside a javascript code, for this i am using the following function,
    function checkList()
    <% String ecode1=(String)session.getAttribute("e_numb"); %>
    var code=<%=ecode1%>
    alert (code)
    this is showing an error can any one please help me,
    thanks
    saurabh

    You have ',%String ecode1' within the javascript. JSP will not recognize 'String' as a java class unless you import the String class. Something like <%@ page import = "java.util.* " %> Incorrect. String is part of java.lang, which is always imported into a java class.
    Most probably what is missing in the javascript is
    - missing quotes ? Not sure if this value is meant to be interpreted as a number or not.
    - missing semicolon
    function checkList()
    <% String ecode1=(String)session.getAttribute("e_numb"); %>
    var code="<%=ecode1%>";
    alert (code);
    }Lets assume that the value of e_numb is "42"
    after running this as a jsp, it should produce the following on the resulting html page. You can see it by viewing the source.
    function checkList()
    var code="42";
    alert (code);
    }Check that to see it has produced valid javascript
    Cheers,
    evnafets

  • HELP.....!!!!! Chinese jsp compilation problem.....

    Hi,
    Could someone please help on the above mentioned?
    I'm using JDeveloper 3.2.3 for my program development under Chinese windows platform. I have created a simple JSP page, which contains few static Chinese words and I have included the line
    <%@ page contentType="text/html;charset=UTF-8"%>
    at the top of the page. When I tried to compile it using encoding "UTF8" (under compiler option), the compiler gave me this error:
    C:\Program Files\Oracle\JDeveloper 3.2.3\myhtml\Chinese_html\ChineseList.jsp
    Error: (0) sun.io.MalformedInputException.
    Btw, when I have removed the line <%@ page contentType="text/html;charset=UTF-8"%> from the page and compile, I've got this error:
    C:\Program Files\Oracle\JDeveloper 3.2.3\myhtml\Chinese_html\ChineseList.jsp
    Warning: (0) ISO-8859-1 character set may not match project compiler setting.
    C:\Program Files\Oracle\JDeveloper 3.2.3\myhtml\Chinese_html\ChineseList.java
    Error: (0) malformed input character in C:\Program Files\Oracle\JDeveloper 3.2.3\myhtml\Chinese_html\ChineseList.java.
    I do appreciate your help on this. Thank you.

    Here's some info one of the JSP Developers sent me:
    1. HELP.....!!!!! Chinese jsp compilation problem.....
    The customer is trying to parse a document generated by
    Windows's notepad. When saved in UTF-8, the byte
    order mark is saved too. We have a know bug that
    JSP parser doesn't recognize Byte Order Mark. The
    bug is : 1915285.
    2. CHINESE CHARACTER ON JSP
    . SQLPLUS depends on NLS_LANG setting. If you
    check the windows registry, the default of NLS_LANG
    depends on the OS. The user environment is Traditional
    Chinese, so does NLS_LANG. If we set NLS_LANG
    to .UTF8, SQLPLUS dumps the data in UTF8, however,
    the command prompt will have problem displaying them.
    . For JSP, as mentioned in a previous mail:
    <%@ page contentType="text/html;charset=UTF-8" %> for all languages
    <%@ page contentType="text/html;charset=GB2312" %> for simplified Chinese
    <%@ page contentType="text/html;charset=Big5" %> for traditional Chinese
    . When you enter Chinese characters on a browser,
    the data is automatically converted to page encoding
    (UTF-8 in your case) before sent back to the server.
    But your receiving servlet/JSP needs to have request
    encoding set correctly.
        I'm not sure about the JDeveloper environment,
    but here is a simple JSP you may try to verify your
    OC4J environment:
    a.    To set up the schema:
    connect scott/tiger
    create table tab01(col varchar2(100));
    b. Edit the connect string in nls.jsp
    c. Run the nls.jsp in oc4j instance.
    <!-- nls.jsp -->
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page import="oracle.jdbc.*,java.sql.*,java.io.*"%>
    <HTML>
    <HEAD>
    <TITLE>Hello</TITLE></HEAD>
    <BODY>
    <%
    request.setCharacterEncoding("UTF-8");
    String sampledata="\u7D20";
    String paramValue = request.getParameter("myparam");
    String connStr = "jdbc:oracle:thin:@dlsun478:5521:j2ee01";
    String user = "scott";
    String passwd = "tiger";
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection(connStr, user, passwd);
    if (paramValue == null || paramValue.length() == 0) { %>
       <FORM METHOD="GET">
       Please input your name: <INPUT TYPE="TEXT" NAME="myparam"
    value="<%=sampledata%>" size=20>
    <BR>
       <INPUT TYPE="SUBMIT" value="Insert Data">
       </FORM>
    <%
      selectData(conn, out);
    else
    %>
       <H1> Insert Data: <%= paramValue %> </H1>
       <br/>
    <%
      insertData(conn, paramValue);
    %>
    <a href="nls.jsp">back</a>
    <%
    %>
    </BODY>
    </HTML>
    <%!
      public void insertData(Connection aConn, String myval)
        try {
          PreparedStatement stmt = aConn.prepareStatement("insert into tab01
    values(?)");
          stmt.setString(1, myval);
          stmt.executeUpdate();
          aConn.close();
        catch (SQLException e) {
          e.printStackTrace();
      public void selectData (Connection aConn, JspWriter out)
        try {
          Statement stmt = aConn.createStatement( );
          ResultSet r = stmt.executeQuery("SELECT col FROM tab01");
          out.println("<H1>List of Data:</H1>");
          while (r.next()) {
            out.println(r.getString(1)+"<br/>");
          aConn.close();
        catch (SQLException e) {
          e.printStackTrace();
        catch (IOException e) {
          e.printStackTrace();
    %>

  • BC4J, JSP, Deployment problems

    I have two simple projects, one containing business components, and the other containing a JSP and a data web bean, which use the application module in the first one. I have deployed successfully the business components project as an EJB to Oracle8i and I am able to connect to it from a simple client code, as well as from the JSP application in JDeveloper 3.2.
    However, when I deploy the JSP application to 9iAS, I get the following exception:
    Exception:
    java.lang.RuntimeException: java.lang.NullPointerException:
    at oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(JSPApplicationRegistry.java:188)
    at oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(JSPApplicationRegistry.java:101)
    at oracle.jdeveloper.html.DataWebBeanImpl.internalInitialize(DataWebBeanImpl.java:464)
    at oracle.jdeveloper.html.WebBeanImpl.initialize(WebBeanImpl.java:54)
    at oracle.jdeveloper.html.DataWebBeanImpl.initialize(DataWebBeanImpl.java:425)
    at oracle.jdeveloper.html.DataWebBeanImpl.initialize(DataWebBeanImpl.java:456)
    at venci.Testdeploy._jspService(_Testdeploy.java:61)
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
    at oracle.jsp.JspServlet.internalService(JspServlet.java, Compiled Code)
    at oracle.jsp.JspServlet.service(JspServlet.java)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at org.apache.jserv.JServConnection.processRequest(JServConnection.java)
    at org.apache.jserv.JServConnection.run(JServConnection.java)
    at java.lang.Thread.run(Thread.java:479)
    I have the properties file in place in a jar and have set the classpath to all the necessary libraries.
    I will appreciate any suggestions.
    Thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Danny Gagliardi ([email protected]):
    I would like to store session type information, ie client_id in a session object and be able to retrieve its value from any of my jsp pages.
    Is there a jsp tag or some other JDev component that I should be using?
    TIA<HR></BLOCKQUOTE>
    You could try something like this in your jsp
    <%
    session.setAttribute("clientId", "1234");
    %>
    To get the clientId from the session try
    <%
    String ClientID = (String) session.getAttribute("clientId");
    %>
    Hope this help,
    Kh

Maybe you are looking for

  • Can family members share rental movies?

    Hi! I wonder if family members (using the Family Sharing feature) can watch rental movies. When I search the internet, I have found info that says one can do so. But it does not work. My husband and I have set up Family Sharing (and the credit card t

  • UMX - Enabling the Remove button on User Role Management screen

    Hi, I tried looking everywhere on how to enable the Remove Button on the UMX Role Screen. Please advice me if anyone knows about this. Appreciate it. Navigation 1 User Management Responsibility 2. Users tab -> look for any user -> click on update but

  • Anyone advise me on how to save and recall the satate information of a cluster of combo boxes?

    I have a set of combo boxes saving a devices state information. I would like to save and recall all the selections. I know there are properties to access the selected items, but searching about, I'm not sure the technique to do this. I would like to

  • Qosmio F60-00Y- Intel RST, TOSHIBA PC Health Monitor crash

    Hi, Just started having problems today with my Qosmio F60-00Y, purchased June 2010. I do have extended warranty but just wanted a quick fix since system is still operational. As I have lost my factory settings recovery I can not reset my system. It i

  • Done with Motion 3 - Thanks to Ripple...

    Thanks to Ripple Training's tutorials on the Motion 3's 3D elements: [Mono|http://www.kultfactory.com/mono.htm] Sincerely, Andrew Message was edited by: Andrew Winter1