Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

northfield Sid

Ranch Hand
+ Follow
since Aug 08, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by northfield Sid

>Are you compiling from the command line?
Yes.
>If so, did you add a copy of servlet.jar to %JAVA_HOME%\jre\lib\ext\ ?
No, but I have now, and it works.
I have in previous occasions installed classpath but on latest installations have not since I was advised by many from the forum not to.
Thanks
I will also be hopefully be learning ANT very soon.
18 years ago
In XP you can set the path by rightclicking on my computer - then go to environment vairables and edit the path but I cannot see any for classpath???
What is the easist way yo use the class path?
----------------------------------------------
Thanks Brogdan,
I want to read ANT, but as you said there is a learning curve, so I think I will do in a months time.
18 years ago
I cannot compile Servlet files on my WinXP environment.
my servlet.jar file is located at
c:\tomcat\jakarta-tomcat-3.3.1\common\lib\servlet.jar
what shall I do?
The error messages are only for servlet portion of code?
18 years ago
Do I put the web.xml file in the WEB-INF folder, that is at the same level as classes folder?
18 years ago
JSP
>Which is line 133
> // Print out the type and file name of each row. while(ftplrs.next()) {
18 years ago
JSP
I am getting this error:
Root cause:
java.lang.NullPointerException
at jsp.portal_0002dproject.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:133)
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)

This is the code as generated by tomcat:

please help???
I have been unable to solve this problem now for a very long time.
Below is my JSP which I call processviewfiles_dir.jsp

I would be grateful for any suggestion, ideas,
and criticism of code. Please let me know if the code be better written etc???
18 years ago
JSP
I swear I have tried the program at home now three times and each time it works fine.
I am totally lost for ideas, why it should not be working at the other location?
19 years ago
JSP
I have so far tried many times to make a program work at another location. Now I am totally lost for ideas.
The program works at home but when I try it in a networked computer everything fails. I do not know why.
I would be grateful if someone would look at my code and test it. Please reply to me here so that I could perhaps send the code.
I would be eternally grateful.
Thank you in advance.
Here is the error, which I get only at the deployment location:
Error: 500
Location: /myJSPs/jsp/portal-project/processviewfiles_dir.jsp
Internal Servlet Error:
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460)
at jsp.portal_0002dproject.processviewfiles_dir_4._jspService(processviewfiles_dir_4.java:163)
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 jsp.portal_0002dproject.processviewfiles_dir_4._jspService(processviewfiles_dir_4.java:133)
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)
19 years ago
JSP
Urgent please help.
I need to solve or I will be in big trouble.
This program works at my home computer.
The hard disk was put onto another computer at another location. Here my program worked but I have tried the same program today but it does not work. Why do I receive this error message???

Error: 500
Location: /myJSPs/jsp/portal-project2/processviewfiles_dir.jsp
Internal Servlet Error:
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460)
at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:162)
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 jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:132)
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)
19 years ago
JSP
I want to create an web.xml page
I frequently access a servlet page with this command:
response.sendRedirect("http://localhost:8080/myJSPs/servlet/portalftp.ServletFaillogin");
Is it possible to avoid typing this tedious line by using the web.xml file?
Here is what I have tried:

so thus the code now becomes:
response.sendRedirect("http://localhost:8080/myJSPs/servlet/faillog");
2nd question:
I have put the web.xml file at this location:
C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs-XML\WEB-INF
The file ServletFaillogin.java and rest of Java pages are at:
C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs-XML\WEB-INF\classes\portalftp
and all my HTML and JSP pages are at:
C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs-XML\jsp\portal-project
19 years ago
Okay I have tried 3 version. I have managed to make one version work using the redirect as suggested but not with the other two why???
response.sendRedirect("http://localhost:8080/myJSPs/servlet/portal.ServletSetDirectoryError");
This works. But the others do not why???
When I do
request.getRequestDispatcher("http://localhost:8080/myJSPs/servlet/portal.ServletSetDirectoryError").forward(request, response);
I get a blank file in the browser and in the status bar the word "DONE"
I have also tried another style:
<jsp:forward page="/myJSPs/servlet/portal.ServletSetDirectoryError" />
Here is get the same blank file and in the status bar the word "DONE"
Why???
19 years ago
JSP
Okay I have changed the line of code to:

I think this could be becuase of the line
" "
All my html and JSP pages are at:
C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs-XML\jsp\portal-project
My class files are at:
C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs-XML\WEB-INF\classes\portal
within the folder portal I have the class:
"ServletFaillogin.java"
But then there is an error loggin into system it does not display my ServletFaillogin page. Instead gives me:
HTTP 404 - File not found
Internet Explorer
Why is this???
19 years ago
JSP
I am using jsp:forward as an JSP tag but getting errors:
Please help

Here is the 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\portal_0002dproject\processftplogin_1.java:94: Missing term.
{
^
C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\portal_0002dproject\processftplogin_1.java:95: Missing term.

^
C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\portal_0002dproject\processftplogin_1.java:95: Missing term.

^
C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\portal_0002dproject\processftplogin_1.java:95: ';' expected.

^
4 errors, 1 warning
19 years ago
JSP
How do I call a Servlet from a JSP page?
I have an JSP page that does a few things but when there is an error I need the JSP page to call a Servlet but do not know how to do it.
I want to call a ServletFailLogin from a JSP page how can I do it?
<html><head>
<title> Login Page </title>
</head>
<body>
<%@ page import= "portal.* " %>
<jsp:useBean class="portal.PortalSystem" id="bean" 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)
{
"http://localhost:8080/test/servlet/ServletFaillogin";
}
%>
...
<h1> You have successfully logged in. </h1>
...
</body>
</html>
19 years ago
JSP