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>

Similar Messages

  • Displaying content in JSP page, want BR but not other Html tags

    I have a page and am reading files and displaying the contents of the files onto the page in a <div> Oneissue is that in the file the end of line are \n or \r\n whichever operation system. I replaced those with <BR> no problem. Now my issue is that I display that in the JSP page:
    <c:out value="${filecontents}" escapeXml="false" />I use escapeXml so that <BR> will add the line breaks. Now my issue is that the file might contains other HTML tags that I want to display simply as text - I don't want the browser to render the other HTML tags.
    Is there a way to do that? Would I have to replace HTML tags with something special?

    Hmm... your file contains HTML tags, but you don't want the browser to interpret them as HTML tags, right? So the way to do that is to use escapeXml="true" in your c:out element.
    But then that also escapes the <BR> tags that you carefully put in there. And you don't want that. You want the browser to interpret those as HTML tags.
    I guess you can't have it both ways. Can you do something like outputting one line of the file at a time with <c:out ... escapeXml="true"> followed by <br>?

  • Please help.  Ipod on desktop but not in itunes!

    Thanks for your help. I can see the ipod icon on desktop when I connect but it doesn't show up in itunes like it used to. This is only on my laptop(ibook). It works fine on my imac. Do I need to reinstall itunes? If i do will I lose all my saved music? Are there some preferences in itunes I need to adjust. Thanks for your help!

    Does this document contain anything useful? Reinstalling iTunes won't erase your music library, either on your machine or your iPod.
    (8499)

  • TS3682 i plug in my iphone 4 and i loss all contact... i try to backup restore but its error say not enough space.  please help me. i want only my contact backup restore not everything. so i dont know how can i do ?

    i plug in my iphone 4 and i loss all contact... i try to backup restore but its error say not enough space.  please help me. i want only my contact backup restore not everything. so i dont know how can i do ?

    Try to connect in recovery mode to restore, without using the latest backup, explained here:
    iOS: Unable to update or restore

  • Please help! I just sync my notes to icloud of my ipad mini but after that all notes has been covered by iphone's and all notes are missing from iPad,how could i restore it?

    Please help! I just sync my notes to icloud of my ipad mini but after that all notes has been covered by iphone's and all notes are missing from iPad,how could i restore it?

    It's very possible that you did just as you suspect. One of the later Note file over wrote the one stored on your iPad when you synced.
    When one does a sync of their iPad a backup of the iPad is created first. If that backup was still available you might be able to find the Note file there. But more than likely, if you are letting the iPad and iPhones sync on their own over Wi-Fi you have over written that back up as well.

  • The status bar is pushed up at about 3/4 of the screen, so I can view onlu firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full vi

    The status bar is pushed up at about 3/4 of the screen, so I can view only Firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full view
    == This happened ==
    Every time Firefox opened

    Your code is absolutely unreadable - even if someone was willing to
    help, it's simply impossible. I do give you a few tips, though: If you
    understand your code (i.e. if it really is YOUR code), you should be
    able to realize that your minimum and maximum never get set (thus they
    are both 0) and your exam 3 is set with the wrong value. SEE where
    those should get set and figure out why they're not. Chances are you
    are doing something to them that makes one 'if' fail or you just
    erroneously assign a wrong variable!

  • When i search for a website it takes me to another website.  I will click on the link and it takes me to one ive never wanted?  please help very frustrating!  I am not very computer savy, is it my settings or something?  Jen

    When I search for a website it itakes me to another website.  I will click on a link and it takes me to something completely different or yellow pages etc. Please help I am very frustrated and not very computer savy!  Thanks!  Jen

    Hi Jeff I have uninstalled Muse from my applications and have tried to download the new version but it displays a message 'file not found'. I have included a screenshot.

  • Please help. My facebook app will not open on my iphone 4. I deleted it,numerous times and downloaded it again. It uploads, but when you click on the icon, it flickers then closes.  Help.

    Please help. My facebook app will not open on my iphone 4. I deleted it,numerous times and downloaded it again. It uploads, but when you click on the icon, it flickers then closes.
    Help.

    Then the next step would be to restore your phone.  My advice is that prior to restoring you import your photos and videos to your computer and back up your contacts (by syncing them with iCloud or to a supported program on your computer using iTunes) as a number of users report losing these when restoring their device.

  • HT204204 i tried to update to ios 8.2 on my iphone 5s when message popup to me now my iphone not working, please help i dont want to lose my data

    hi
    i tried to update to ios 8.2 on my iphone 5s when message popup to me now my iphone not working, please help i dont want to lose my data

    What is the exact text of the message you got? And did you not back up before you updated?

  • Printer just started feeding a blank page after some, but not all printed documents

    Printer just started feeding a blank page after some, but not all printed documents

    Hi @cam21 ,
    I understand that you are having issues printing, after some documents you are getting blank pages. I would be happy to help you.
    I would do a hard reset to see if that will resolve the issue.
    Leave the printer on and unplug the power cable from the printer and wall outlet for 60 seconds.
    Then reconnect the power cable to the printer and wall outlet rather than a surge protector.
    This ensures the printer is receiving full power and may help this situation.
    What application are you printing from?
    It may be a setting in the application.
    Does this happen from all applications?
    Download and run the Print and Scan Doctor. It will diagnose the issue and might automatically resolve it. http://www.hp.com/go/tools>Using HP Diagnostic Tools for HP Printers in Windows.
    How is the printer connected? (USB/Ethernet/Wireless)
    What were the results when you ran the Print and Scan Doctor? (did it print or scan, any error messages)
    If there is anything else I can help you with, just let me know.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Error:  Namespace prefix 'split-by-page-break' used but not declared.

    I have my machine reimaged, now when I try to preview an rtf template I get the below error. Nothing has changed in my template and I am using 1.0.0 Build 9 as before my reimage as well. This is an uregent problem that I am not able to find the solution for on my own. Please advise with any help.
    Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'split-by-page-break' used but not declared.
         at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:782)
         at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:564)
         ... 14 more
    Thanks

    I'm just new to XMLP and am receiving the same error.. My error is occuring when trying to use sub-templates in my master template.
    I believe I have the syntax correct:
    To import template file:
    <?import:file:h:///CN_LTR_TEMPLATES.rtf?>
    to call the sub-template:
    <?call-template: signature:?>
    Its the call-template to signature thats generating my error message.. My only thought is that its not calling my import properly..
    Anyway.. Hope this might help you a bit.. you never mentioned anything about using a sub-templates. Perhaps since you formated your computer, your template may be in a different location or gone all together (that is if you are using sub-templates).
    If i figure anything out in the mean time, i'll let you know..
    Edited by: user8682333 on Aug 16, 2009 6:51 AM

  • Ever since upgrading to Mountain Lion, my AOL messages sometimes, but not always open with a blank page. If I open AOL in Firefox, the messages open fine.  This does not happen with any messages by any means, and it is not any type of certain message

    Ever since upgrading to Mountain Lion, my AOL messages sometimes, but not always open with a blank page. If I open AOL in Firefox, the messages open fine.  This does not happen with any messages by any means, and it is not any type of certain message. In fact, in the same screen I can often open an email from the same sender with email intact. This is weird. Sometimes I close the page and open a new page. Sometimes that works and sometimes it does not. It is a very annoying thing.

    Hi,
    When you start Messages fro the first time you are asked for an Apple ID
    When this is verified and entered it appears in Messages Menu > Preference > Accounts and is Enabled.
    The App should have also picked on on those iChat Accounst you had before.
    These should be Enabled if they were when you last used iChat.
    Exactly which "Accounts" are logged in can be seen in Message Menu > Accounts and will include the iMessage "Account" and Bonjour.
    In the Window menu you will see CMD +0 for the Messages window and CMD+1 for the "Buddies" window which is a combined list at this stage.
    Go to the Preferences > General Section and Untick the "Collect all accounts into one list".
    This will give you separate iChat type Buddy lists.
    You can check if that account/Buddy list is set to Invisible or if in the Preferences > Accounts > Security you have settings that will block some people from seeing you as On line.
    You are saying Buddies can see you as On Line which implies they are still sending to your AIM based Names (@Mac.com is a valid AIM Screen Name)
    I am not sure from your post if you are trying to iMessage their email IDs thinking they are Apple IDs and that they are using Messages as well.
    There is no Buddy list for iMessages side
    No-one can tell you are "On Line" until they have your details in the "To" spot in Messages with the correct iMessaged contact info (iPhone Number or Apple ID)
    Obviously an Apple ID can be an email or look like one.
    In some cases they are also valid AIM Screen Names as well.
    In the case or the @mac.com name you may have linked this Apple ID to iMessages as well.
    11:31 PM      Saturday; August 11, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Please help us to want siri iphone 4s Turkish emergency. I also want to get siri türkce have to jailbreak to iPhone original, THANK YOU

    Please help us to want siri iphone 4s Turkish emergency. I also want to get siri türkce have to jailbreak to iPhone original, THANK YOU

    Sorry. This makes no sense.
    There are 3 supported carriers in Turkey from which you can get an iPhone.
    http://support.apple.com/kb/HT1937?viewlocale=en_US&locale=en_US
    Jailbreaking can not be discussed here.

  • Please help me my apple id its not working what do i do?

    please help me my apple id is not working what do i do

    If you desire speedy resolution it helps to be more specific with error messages etc. when asking a question here.
    iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html > Get iTunes support via Express Lane > iTunes > iTunes Store

  • I'm battling to change my primary iCloud account on my mac, please help? I want to replace it with my secondary account by can't find a way to do this?

    I'm battling to change my primary iCloud account on my mac, please help? I want to replace it with my secondary account by can't find a way to do this? Tony

    System Preferences/iCloud - log out and then log in with your other ID.
    https://discussions.apple.com/thread/3390335?tstart=0
    Set up iCloud
    Set up iCloud (2)

Maybe you are looking for

  • MSI Kt6 and NEW Msi 6600GT AGP will not boot up!

      My Girlfriend's computer. I put this new video card in today MSI 6600GT AGP .For the 2nd time. It frezzing up at startup on this screen.... "GO TO SET UP ...Press F11 , F10 ,Tab: LOGO Ckecking NVRAM..." I rma the 1st one . Now 2nd 6600 Gt card same

  • HT1339 How to fix and restore firmware?

    I own a iPod Classic 5th Gen Video and have been getting many problems with it with connecting it to my PC or having it to work properly, I find that it likes to lock up quite often.  I've tried to use iTunes and it doesn't see it. How do I fix/resto

  • SQL trace for Background jobs

    Hi Can anyone suggest how to find the SQL trace for background jobs. Thanks in advance. Regards D.Vadivukkarasi

  • Getting current row or cursor

    Hi all, I'm using FM 'REUSE_ALV_GRID_DISPLAY' in my program. However, I'm having problem getting the current row or the cursor position in my ALV. If possible, I do not wish to use OO method in doing this. Is there any other way?

  • Upgraded To Snow Leopard And Now The Mic Is Not Working

    I upgraded to Snow Leopard, and now my mic input is not woking on my 2 year old MacBook Pro. Can you tell me how to fix it?