This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!

tarun bansal

Greenhorn
+ Follow
since Mar 21, 2006
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 tarun bansal

Thanks a lot
Actually I had set JAVA_HOME to 1.3 for running the j2ee server
but forgot to change it to 1.4 for jsp
15 years ago
JSP
I am able to extract the files
15 years ago
JSP
From tomcat jsp-examples itself
15 years ago
JSP
Hi

I am trying to run the following jsp



But tomcat is throwing an exception

org.apache.jasper.JasperException: Unable to read TLD "META-INF/c.tld" from JAR file "file:/C:/Tomcat/webapps/Error/WEB-INF/lib/standard.jar": java.lang.IllegalStateException: zip file closed
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:411)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:183)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:181)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)





can anyone tell me the reason for this.

I had put the jar files in the /WEB-INF/lib folder and do nat had any web.xml file for the application
15 years ago
JSP
Hi

I had the following code for a JSP page that will throw an artheimatic exception:



and the following code to handle that exception



But whenever i accesses the badPage.jsp file, instead of taking me to the errorPage.jsp it is showing a generic error message that "The page cannot be displayed". Can you tell me where is the problem.
15 years ago
JSP
Hi

I had a simple JSP file, the code for which is as follows



I had put the image file in the images sub directory under my app directory.
Even then the JSP page is not showing the image
15 years ago
JSP
Thanks a lot

Indeed it is the problem with EL enabling
after adding following lines to wb.xml it is working

<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-enabled>true</scripting-enabled>
<scripting-enabled>true</scripting-enabled>
</jsp-property-group>
</jsp-config>
15 years ago
JSP
Hi

I had written a servlet to set the attribute as follows:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;



and the code for forEach.jsp is :



but instead of the complete table i am getting the following out put:

Movie List :

${movie}


Can you tell me where am i wrong?
15 years ago
JSP
The full Stack is

StandardWrapperValve[testJSP]: Servlet.service() for servlet testJSP threw exception
org.apache.jasper.JasperException: Cannot find any information on property 'count' in a bean of type 'foo.Counter'
at org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:837)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1015)
at org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1062)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Generator.generate(Generator.java:3272)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at testServlet.doGet(testServlet.java:18)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
15 years ago
JSP
Hi

I had developed a sample web app which contains a counter class, the code for which is
package foo;

public class Counter{
private static int count;
public static synchronized int getCount(){
count++;
return count;
}
public static void setCount(int y){
count=y;
}
}
I am setting the counter attribute in the request scope with the servlet, testServlet, the code for which is

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class testServlet extends HttpServlet{

public void doGet(HttpServletRequest request,HttpServletResponse response)
throws IOException,ServletException{

response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.println("In Servlet");
foo.Counter c=new foo.Counter();
c.setCount(9);
request.setAttribute("Counter",c);

RequestDispatcher view=request.getRequestDispatcher("test.jsp");
view.forward(request,response);
}
}

Now i am trying to access this attribute in a JSP namely test.jsp the code for which is

<html><body>
<jsp:useBean id="counter" class="foo.Counter" scope="request"/>
person created by servlet:<jsp:getProperty name="counter" property="count"/>
</body></html>

however tomcat server is giving me a 500 error message.

Please anylyse the code and tell me where i had made a mistake.

Thanks and Regards,

Tarun Bansal
15 years ago
JSP
Hi,

I am not clear about the concept of a container for a servlet and an EJB and also what are the tasks performed by the container?
15 years ago