HELP: jsp cookie problem

Hi,
1) I have a page (index.jsp) that looks for a cookie, if the cookie isn't there it redirects to a login page.
2) The login page, on submit, calls a servlet that sets the cookie (when usr and pwd are valid). Then the servlet redirects to the original page (index.jsp).
3)The problem is, when redirected to the index.jsp, index.jsp cannot see the cookie -- so it redirects to login.jsp again. But if I refresh index.jsp it sees the cookie and works fine.
So it looks like the cookie isn't totally set between the addCookie in the servlet and the load of the index.jsp. Is there so kind of "commit" or something I'm supposed to do after the "addCookie" to make it take correctly?
Here are some code snippets -- any help is greatly appreciated!
# the servlet
response.addCookie(new Cookie("loggedin-username", sUsername));
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/index.jsp");
dispatcher.forward(request, response);
# the index.jsp
<%
     Cookie[] cookies = request.getCookies();
     boolean bLoggedIn = false;
     int i=0;
     while ( (cookies != null) && !bLoggedIn && (i<cookies.length) ) {
          if (cookies.getName().equals("loggedin-username")) {
               Cookie c = cookies[i];
               bLoggedIn = (c.getValue() != null);
          i++;
     if (!bLoggedIn) {
          response.sendRedirect("login.jsp");
%>
You are logged in.
<p>

2) The login page, on submit, calls a servlet that sets the cookie (when usr and pwd are valid). Then the servlet redirects to the original page (index.jsp).No the Servlet does a RequestDispatcher.forward to the index.jsp. A forward is a server side action that does not go to the browser and the target Servlet/JSP gets the original request and response objects.
So in the Servlet you set the cookie.
response.addCookie(new Cookie("loggedin-username", sUsername));Notice that you set it in the response object.
Then the forward
dispatcher.forward(request, response);And then the JSP looks for the cookie.
Cookie[] cookies = request.getCookies();Notice it looks in the request for the cookies but since the response has not gone to the browser the browser has not had the opportunity to add the cookie into the request.
Then the forward

Similar Messages

  • HELP: JSP deployment problems

    Hi,
    We have been working hard to resolve our deployment problems, but we are stuck at the following point.
    We create the following directory tree.
    htdocs/debis/
    htdocs/debis/WEB-INF/
    htdocs/debis/welcome.jsp
    htdocs/debis/mail/
    htdocs/denis/mail/readmail.jsp
    welcome.jsp works fine.
    now the problem is readmail.jsp cannot access the beans in the WEB-INF. mail tries to become a new application root. So we added another WEB-INF under mail, but then it turned out that different application roots are unable to share sessions. What we want to achieve is to have one application root, with several sub applications which are sharing sessions.
    Currently we put all jsp files in the
    htdocs/debis
    directory to make it work. However the directory is now full of jsp files, which we are having hard time determining which belongs to which sub application.
    What should we do?
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by RamkumarP:
    Where is the Bean class? Is it directly under WEB-INF or under the WEB-INF/classes folder? Have you created a classes folder under WEB-INF?<HR></BLOCKQUOTE>
    Hi, I am a newbie in running JSP in Apache with Oracle 9iAS. I have only worked with JSPs in Tomcat. Please bear with me.
    Before I can run the JSPs in the htdocs/myJSPapp/, beans & servlets in htdocs/myJSPapp/WEB-INF/ folder, what do I need to have installed ?
    Is it OSE + mod_ose + Apache + 9iAS ?
    Or is there a better alternative for serving out JSPs ?
    Thanks!

  • 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();
    %>

  • Cookies problem

    hi..
    i have a cookie problem in my jsp page..everytime it causing problem...if the file is not in existence it displays it contents...
    i have a jsp page with servlets...
    help me

    i still fail to see why you call it a cookie problem.
    Make sure the jsp result is not cached in your browser or firewall.
    Try redeploying your entire web-app.

  • 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]

  • Cookie problem in APEX 4.1.1

    After upgrading from APEX 4.1 to 4.1.1 the first time a user visits a particular application they see a line at the top of the page of the form:
    "Set-Cookie: PUBLIC_WWV_CUSTOM-F_1047528391177278_666=1316663583787701; HttpOnly "
    As soon as they refresh the page, the text disappears. I believe this is related to the issue of larger cookie sizes in 4.1.1 that a lot of people seem to be experiencing with NTLM authenthication. However, this is occuring at the login page prior to authentication. There is an application process with a processing point of "On New Instance (new session)" with the following code to create a cookie:
    owa_util.mime_header('text/html', FALSE);
    owa_cookie.send(
    name => 'PPP_SESSSION',
    value => to_char(v('APP_SESSION')),
    domain => '.dooda.com',
    path => '/');
    owa_util.http_header_close;
    As soon as I remove that process, the issue goes away. Of course that raises more troublesome issues. :)
    The workaround for the NTLM/cookie problem doesn't seem applicable here. Does anyone have any suggestions?
    Am I leaving out any helpful information? (I'm not so familiar with APEX and I don't know jack about web development).
    Thanks for any help.
    Chris

    Chris,
    This is a little bit of a guess here, but can you try removing the line:
    owa_util.http_header_close;
    from your On New Instance process?
    What appears to be happening is APEX is attempting to write the session cookie, but the HTTP headers have already been closed.
    Joel

  • This has happened on several computers. I can download using video download helper with on problems until I attempt to download "Dishonorable Disclosures" on Yo

    This has happened on several computers. I can download using video download helper with on problems until I attempt to download "Dishonorable Disclosures" on You Tube once a download attempt is made on that video download helper stops working for that video or any other video. Could this be a virus or malware? How do I fix download helper after this happens?

    Which movie do you mean?
    Try to clear the Google cookies.
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    *http://kb.mozillazine.org/Cookies
    You can also try to delete the webappsstore.sqlite file in the Firefox Profile Folder to clear the local storage.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Help,JSP and SERVLETS!

    hello:
    i've downloaded ECLIPSE 3.2,TOMCAT 5.5 .
    i tried to build simples examples o servlets but i failed could you please tell me how to proceed?i'm new at this plus i've got a project to do with all this so plz can you give some links to go,i tried but no links was clear.
    i've got to give to my professor an examples executed (servlets,jsp)
    thank you

    HISSO wrote:
    i wil give up on talking about stupid gossip
    you must act professional and i you can't help it's ok
    so plz i juste want help
    i'm so busy finishing my studies
    when it comes to talk about development with tomcat and eclipse together i'm new so i need some advices,so plz let's be serious!
    i'm working hard to finish my project!Try to communicate less like a monkey with electrodes attached to it's genitals. This means stop using words like "plz" and write "please" instead.
    If you want specific help with a specific problem then you should ask a specific question. "help, JSP and SERVLETS" is not a specific question. And you should also note that if your specific question is about Tomcat specifically or Eclipse specifically then you are in the wrong place to begin with.
    So do you want to try again?

  • Please help, jsp page wants missing ";" but not to good with jsp?

    I have a JSP page called ftplogin.jsp
    I want the jsp page to call a ftpbean.
    It will pass server, username and login into the ftpbean.
    It will then set the directory and finaly retrieve a a document from it.
    The ftpbean works but my jsp page doesn't. Please help with compilation problem?????
    Please also tell me if the syntax of accessing the bean is correct?
    <!-- ftplogin.jsp -->
    <html>
    <head>
    <title> FTP Login </title>
    </head>
    <body>
    <%@ page import= "ftp.* " %>
    <jsp:useBean class="ftp.FtpBean" id="ftpbean" scope="session" />
    <%
    try
    String servername = request.getParameter("serverName");
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    ftpbean.ftpConnect(servername, username, password);
    catch(Exception e)
    %>
    Sorry but your must have entered an incorrect login ingotmation.
    You are not allowed to login.
    Please leave the ftp portal.
    <%
    %>
    <h1> Welcome to the FTP Login. </h1>
    <FORM ACTION="ftplogin.jsp" METHOD=post>
    Please login
    Enter name of server:
    <input type="text" name="servername"><br>
    Enter user name?
    <input type="text" name="username"><br>
    Enter password
    <input type="text" name="password"><br>
    <input type="submit" name="Submit info">
    </FROM>
    <%=
    try
    // set the directory
    ftpbean.setDirectory("/home/eland/u6/k3074/w0109699/simple-bean");
    catch(Exception e)
    System.out.println(e);
    %>
    <%=
    try
    // Get the binary file '????' and save it to hard disk
    // the name will be 'local_file_name' .
    ftpbean.getBinaryFile("accessbean.jsp", "local_file_name", this);
    catch(Exception e)
    System.out.println(e);
    %>
    <%=
    try
    ftpbean.close();
    catch(Exception e)
    System.out.println(e);
    %>
    </body>
    </html>
    Location: /myJSPs/jsp/grid-portal-project/ftplogin.jsp
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile Note: sun.tools.javac.Main has been deprecated.
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\ftplogin_1.java:110: Missing term.
    out.print(
    ^
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\ftplogin_1.java:110: ')' expected.
    out.print(
    ^
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\ftplogin_1.java:120: Missing term.
    ^
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\ftplogin_1.java:120: ';' expected.
    ^
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\ftplogin_1.java:121: Invalid expression statement.
    ^
    5 errors, 1 warning
         at org.apache.tomcat.facade.JasperLiaison.javac(JspInterceptor.java:898)
         at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:733)
         at org.apache.tomcat.facade.JspInterceptor.requestMap(JspInterceptor.java:506)
         at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java:968)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:875)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:536)

    Please note I have solved the compilation problem.
    But now getting runtime error. Here is the error:
    Error: 500
    Location: /myJSPs/jsp/grid-portal-project2/ftplogin.jsp
    Internal Servlet Error:
    javax.servlet.ServletException
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460)
         at jsp.grid_0002dportal_0002dproject2.ftplogin_1._jspService(ftplogin_1.java:128)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
         at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
         at org.apache.tomcat.core.Handler.service(Handler.java:235)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:536)
    Root cause:
    java.lang.NullPointerException
         at java.net.Socket.(Socket.java:282)
         at java.net.Socket.(Socket.java:118)
         at ftp.FtpBean.ftpConnect(FtpBean.java:323)
         at ftp.FtpBean.ftpConnect(FtpBean.java:293)
         at jsp.grid_0002dportal_0002dproject2.ftplogin_1._jspService(ftplogin_1.java:91)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
         at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
         at org.apache.tomcat.core.Handler.service(Handler.java:235)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:536)
    Here is my directory structure for ".jsp" and ".html" pages:
    C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs\jsp\grid-portal-project2
    Here is my directory structure for java classes,
    C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs\WEB-INF\classes
    ftp
    ftp\FtpBean.java
    ftp\FtpBean.class
    Here is the modified source code:
    <html>
    <head>
    <title> FTP Login </title>
    </head>
    <body>
    <%@ page import= "ftp.* " %>
    <jsp:useBean class="ftp.FtpBean" id="ftpbean" scope="session" />
    <%
               String servername = request.getParameter("serverName");
               String username   = request.getParameter("username");   
               String password   = request.getParameter("password");
               ftpbean.ftpConnect(servername, username, password);
    %>
    <h1> Welcome to the FTP Login. </h1>
    <FORM ACTION="ftplogin.jsp" METHOD=post>
    Please login
    Enter name of server:
    <input type="text" name="servername"><br>
    Enter user name?
    <input type="text" name="username"><br>
    Enter password
    <input type="text" name="password"><br>
    <input type="submit" name="Submit info">
    </FORM>
      <% 
               ftpbean.setDirectory("/home/eland/u6/k3074/w0109699/simple-bean");
      %>
      <%
               ftpbean.getBinaryFile("accessbean.jsp", "local_file_name");
      %>
      <%
                ftpbean.close();
      %>
    </body>
    </html>

  • JavaBean - JSP - JSTL - Problem

    Hi, (sorry for the length of this message)
    I have a problem I can't figure out using JavaBeans, JSP, and JSTL. I have two JavaBeans Scoring.java and ScoringManager.java that I use to display some stats over a JSP page with JSTL tags.
    The Scoring.java bean contains all the info related to a the scoring (ie column definitions - GP, G, A, etc.) and the ScoringManager.java handles operations that use the Scoring.java Bean.
    I've use the following methods as well as the executeAdvancedQuery method (which executes the given SQL query on the database - not shown here) and it works fine.
    public Iterator getScorerListIterator( )
    throws SQLException
    return this.getScorerList().listIterator();
    public ArrayList getScorerList( )
    throws SQLException
    String query = "SELECT TOP 30 * FROM vGlobalLeaSea ORDER BY PTS desc, GP asc, G desc;";
    return executeAdvancedQuery(query);
    And this works nicely using this code in a JSP page.
    <jsp:useBean
    id="scoreMan"
    class="com.test.stats.ScoringManager"
    scope="session"
    />
    <table width="180" border="0" cellspacing="0" cellpadding="2">
    <tr>
    <td width="30" class="tsbg1">GP</td>
    <td width="30" class="tsbg1">G</td>
    <td width="30" class="tsbg1">A</td>
    <td width="30" class="tsbg1">PTS</td>
    </tr>
    <c:forEach items="${scoreMan.scorerListIterator}" var="scoreInfo">
    <tr>
    <td width="30" class="tsbg2"><c:out value="${scoreInfo.gamesPlayed}"/></td>
    <td width="30" class="tsbg2"><c:out value="${scoreInfo.goals}"/></td>
    <td width="30" class="tsbg2"><c:out value="${scoreInfo.assists}"/></td>
    <td width="30" class="tsbg2"><c:out value="${scoreInfo.points}"/></td>
    </tr>
    </c:forEach>
    </table>
    Here's the problem! I want to be able to recuperate a parameter from the address bar (/thepage.jsp?id=2) and pass it to the following methods:
    public Iterator getScoringListBySeasonIterator(int seasonId)
    throws SQLException
    return this.getScoringListBySeason(seasonId).listIterator();
    public ArrayList getScoringListBySeason(int seasonId)
    throws SQLException
    String query = "SELECT * FROM vGlobalLeaSea "
    + "WHERE sd_id = "+ seasonId +";";
    return executeAdvancedQuery(query);
    And here's the code I think should be ok... that isn't
    <jsp:useBean
    id="scoreMan"
    class="com.test.stats.ScoringManager"
    scope="session"
    />
    <table width="180" border="0" cellspacing="0" cellpadding="2">
    <tr>
    <td width="30" class="tsbg1">GP</td>
    <td width="30" class="tsbg1">G</td>
    <td width="30" class="tsbg1">A</td>
    <td width="30" class="tsbg1">PTS</td>
    </tr>
    <c:forEach items="${scoreMan.scorerListBySeasonIterator[param.id]}" var="scoreInfo">
    <tr>
    <td width="30" class="tsbg2"><c:out value="${scoreInfo.gamesPlayed}"/></td>
    <td width="30" class="tsbg2"><c:out value="${scoreInfo.goals}"/></td>
    <td width="30" class="tsbg2"><c:out value="${scoreInfo.assists}"/></td>
    <td width="30" class="tsbg2"><c:out value="${scoreInfo.points}"/></td>
    </tr>
    </c:forEach>
    </table>
    I've taken car to use an java.util.Iterator as Java type for the items and dynamic values are allowed.
    I've search the web and read many articles to find an answer but I always end up with some 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: An error occurred while evaluating custom action attribute "items" with value "${scoreMan.scorerListBySeasonIterator[param.id]}": Unable to find a value for "scorerListBySeasonIterator" in object of class "com.test.stats.ScoringManager" using operator "." (null)
         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:536)
    root cause
    javax.servlet.ServletException: An error occurred while evaluating custom action attribute "items" with value "${scoreMan.scorerListBySeasonIterator[param.id]}": Unable to find a value for "scorerListBySeasonIterator" in object of class "com.test.stats.ScoringManager" using operator "." (null)
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:494)
         at org.apache.jsp.leaseaTestJAVA_jsp._jspService(leaseaTestJAVA_jsp.java:409)
         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:536)
    Anyone has a clue?
    Thanks in advance for any help!
    John

    The problem comes with the fact you are breaking the JavaBeans rules. There are strict rules to follow to make JavaBeans work...
    You set paramaters using
    public void setParamName(ParamType value)
    methods.
    You get parameters with
    public ParamType getParamName()
    methods.
    You can not pass a value into a get method, the argument list must be void.
    So to do what you want, you should create a ne parameter, called seasonId:
      private int seasonID = -1;
      public void setSeasonID(int i) { seasonID - i; }
      public int getSeasonID() { return seasonID; }Then use that for your getScoringListBySeason() method... but I would also throw an IllegalStateException if the seasonID was not set yet...
      public Iterator getScoringListBySeasonIterator() { return getScoringListBySeason().iterator(); }
      public List getScoringListBySeason()
        if (seasonID == -1) throw new IllegalStateException ("Season ID Must be set before the Scoring List can be retrieved.");
        //.. rest of code
      }Then in your JSP you would do this:
      <jsp:useBean class="com.test.stats.ScoringManager" id="scoreMan" scope="session"/>
      <jsp:setProperty name="scoreMan" property="seasonID" value="${param.id}"/>Then you should be able to work with the scoringListBySeason and scoringListBySeasonIterator properties as you did the other get methods...

  • My Itunes is no longer allowing me to manage my music on my phone i can no longer select on my iphone to make playlists and delete music. Please help fix my problem.

    My Itunes is no longer allowing me to manage my music on my phone i can no longer select on my iphone to make playlists and delete music. Please help fix my problem. Iphone4s, 32gigs, IOS 7.1.2
    I don't know why it stopped working but it happened a month or two ago but the option on this phone that's usually all the way to the left when you select your device but now its not and I don't know what caused it. ive already tried troubleshooting my problem but have found no help.

    Hello Salmomma,
    Thank you for the details of the issue you are experiencing when trying to connect your iPhone to your Mac.  I recommend following the steps in the tutorial below for an issue like this:
    iPhone not appearing in iTunes
    http://www.apple.com/support/iphone/assistant/itunes/
    Additionally, you can delete music directly from the iPhone by swiping the song:
    Delete a song from iPhone: In Songs, swipe the song, then tap Delete.
    iPhone User Guide
    http://manuals.info.apple.com/MANUALS/1000/MA1658/en_US/iphone_ios6_user_guide.p df
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • I need advise and help with this problem . First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product . At the present time I'm having lots of problems with the router so I was looking in to

    I need advise and help with this problem .
    First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product .
    At the present time I'm having lots of problems with the router so I was looking in to some info , and come across one web site regarding : port forwarding , IP addresses .
    In my frustration , amongst lots of open web pages tutorials and other useless information , I come across innocent looking link and software to installed called Genieo , which suppose to help with any router .
    Software ask for permission to install , and about 30 % in , my instinct was telling me , there is something not right . I stop installation . Delete everything , look for any
    trace in Spotlight , Library . Nothing could be find .
    Now , every time I open Safari , Firefox or Chrome , it will open in my home page , but when I start looking for something in steed of Google page , there is
    ''search.genieo.com'' page acting like a Google . I try again to get raid of this but I can not find solution .
    With more research , again using genieo.com search eng. there is lots of articles and warnings . From that I learn do not use uninstall software , because doing this will install more things where it come from.
    I do have AppleCare support but its to late to phone them , so maybe there some people with knowledge , how to get this of my computer
    Any help is welcome , English is my learned language , you may notice this , so I'm not that quick with the respond

    Genieo definitely doesn't help with your router. It's just adware, and has no benefit to you at all. They scammed you so that they could display their ads on your computer.
    To remove it, see:
    http://www.thesafemac.com/arg-genieo/
    Do not use the Genieo uninstaller!

  • How do I copy files onto a hard drive (device) from Mac 2 7 pc. I'm able to transfer files from device but cannot transfer files to device. Anyone had same problem or can help solve this problem? Help pls

    how do I copy files onto a hard drive (device) from Mac 2 7 pc. I'm able to transfer files from device but cannot transfer files to device. Anyone had same problem or can help solve this problem? Help pls

    Welcome to Apple Support Communities
    When you try to copy data to the external drive, what happens? If you don't see any error, the external drive is formatted in NTFS, and OS X can't write in it.
    To be able to write on this external drive, you have to use an app like Paragon NTFS. Another solution would be to format the external drive in FAT32 or exFAT with Disk Utility > http://pondini.org/OSX/DU1.html Make sure you copied all the files of the external disk to the internal disk before doing it

  • I'm new to Mac and I have a Mac Mini. Could you please tell me how I could paste an URL to a video downloader like "Coolmuster Video Downloader for Mac"? I can copy the url but I could not paste it on the downloader. I appreciate your help to my problem.

    I'm new to Mac and I have a Mac Mini. Could you please tell me how I could paste an URL to a video downloader like "Coolmuster Video Downloader for Mac"? I can copy the url but I could not paste it on the downloader. I appreciate your help to my problem.

    Is this happing because the external is formatted to PC and not mac?
    Yes that is correct.
    Will I need to get a mac external hard drive if I wish to continue to save my documents like this?
    If you no longer use a PC you could format this drive for the Mac. However be aware that formatting a drive will erase all the data on it. So you would need someplace to copy the data off this drive to while you did the re-format and then you could copy the data back.
    You could get another drive, format it for the Mac and copy the data to it. Then re-format the original drive and use it as a backup drive. Always good to have backups.
    Post back with the drive type and size of the current drive, if you are doing backups now and how and if you still need to access this drive from a PC.
    regards

  • Adobe encore the software that's used to decode the media is not available on this system. installing the correct decoders for the file you are working with may help correct the problem

    Hi,
      I got this message after importing about ten or so H.264 files that I encoded from Adobe media encoder.  "adobe encore the software that's used to decode the media is not available on this system. installing the correct decoders for the file you are working with may help correct the problem."
    The files we're shot with HD cameras.  Edited in Premiere Pro CS3.  I installed the update 3.0.1 with still the same error.
    I also tried a brand new project and after about ten or so files being imported into a timeline, the system crash.  I tried this twice....
        Thanks in Advance

    Hi Hunt,
           Here is the skinny.  A window base PC.  footage shot with HD sony HD cameras,  Project imported to Premiere CS3.  Once completed sent file to Adobe media encoder and render them as H.264 widescreen high Quality.  Imported them to Adobe Encore CS3.  After about ten files or so.  I got the error message.  Did all the basic trouble shoot like restarting the computer, got latest patch.  Even build a new test project with the same problem.
        Something else I read in the forums, is the encore will transcoded the project to Mpeg 2 anyway, after looking at my project I realized those few files were indeed untranscoded.  So it will be a double compression and I dont want that.  So, my new question is, what is H.264 good for ?????????? I was research that Mpeg 2 is a faster render but H.264 is a slower render but better quality.....
       what do you think ????
       Peter

Maybe you are looking for

  • Why does a new tab page open along with my home page?

    When I go online, I expect to have only my home page open, instead, I have two tabs, my home page tab and New Tab and the New Tab page is the page that actually opens. This just started yesterday, why??

  • ODS Designing.

    Hi Bw Experts,    Currently i am developing the report for <b>Advance Payments for Suppliers</b> according to the Project.I have identified the datasource as 0FI_AP_4.For project details i have identified the datasource as 0PROJECT_ATTR.I have a doub

  • How to recover a deleted numbers file in icloud

    How do I recover a deleted numbers file that was saved in icloud Can files be saved on Mac and I cloud at the same time

  • After changing from cs5.5 to cs6 my javascript pop-up not Working??

    Hello, maybe someone could figure this one out. I have a file that I have done on CS5.5 and everything works fine, just simple ActionScript 2 and a script: on (release) { getURL("javascript:openNewWindow('http://xxxxxxx.html','thewin','height=800,wid

  • About layout for web dynpro project

    i have a component named Acomp in my WD proejct. i have two views named AView and BView ; i have a windows,viewSet(1,2):(1,1) for Aview,(1,2) for Bview; in AView:i have two buttons named displayBut and closedBut; i do:    1.if i click the button of d