Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

javax.servlet.jsp.*. compiler error  RSS feed

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have both jsp-api and servlet-api in my common lib directory though i am still having problem when i am trying to compile a java file with import javax.servlet.jsp.*. I will greatly appreciate if any one can let me know what i am doing wrong.


tomcat-5.5 jsp-2.0
 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kinds of errors? Are you certain that the pages are syntactically correct?
 
Marshal
Posts: 67163
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Placing the jar files in common/lib will automatically make them available at execution time but will do nothing automatic for you at compile time. You must still add them to your compilation class path.
 
srikanth arroju
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i solved the above problem by placing jsp-api.jar in ext directory of jdk
but now when i try to execute it displaying a exception

exception
org.apache.jasper.JasperException: org/apache/taglibs/standard/tag/rt/core/IfTag
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause
javax.servlet.ServletException: org/apache/taglibs/standard/tag/rt/core/IfTag
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:843)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:776)
org.apache.jsp.Ssc_jsp._jspService(Ssc_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause
java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/rt/core/IfTag
org.apache.jsp.Ssc_jsp._jspx_meth_c_if_0(Ssc_jsp.java:94)
org.apache.jsp.Ssc_jsp._jspService(Ssc_jsp.java:71)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think the JSP you are trying to execute uses standard tags,try adding jstl.jar and standard.jar to WEB-INF/lib

Regards,
Srikkanth
 
Bear Bibeault
Marshal
Posts: 67163
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by srikanth arroju:
i solved the above problem by placing jsp-api.jar in ext directory of jdk



Bad idea. Now you have two copies of the jar which can easily get out of sync with each other. You should compile against the same jar that will be used at execution time.

Just add the common/lib jars to your compilation classpath.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!