The Artima Developer Community
Sponsored Link

Java Answers Forum
Apache Tomcat

1 reply on 1 page. Most recent reply: Aug 23, 2003 7:46 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
J Stevens

Posts: 7
Nickname: js
Registered: Jul, 2003

Apache Tomcat Posted: Aug 22, 2003 1:47 PM
Reply to this message Reply
Advertisement
Does anyone know if the following class has been depreciated -
import org.apache.jasper.runtime.*;

I was trying to create two servlets just to see if I could create an e-commerce java enabled site. These files would use a session object to keep track of a users selections for an e-commerce based idea. I would make it so that the user would add items selected by using the doGet() method to add items to the session.
In the doPost() method , I would add the code to display the contents of the session object.
I would have to use Vector rather than String[] so can add previous selections, rather than replace.

Then use a database table using SQL, creating these tables to hold the data.

The point is that when I tried using org.apache.jasper.runtime, and HttpJspBase, I am getting an error message (see below)



line 6: package org.apache.jasper.runtime does not exist
import org.apache.jasper.runtime.*;
^
line 9: cannot resolve symbol
symbol : class HttpJspBase
location: class org.apache.jsp.ShowNames_jsp
public class ShowNames_jsp extends HttpJspBase {
^
2 errors

Process completed.


package org.apache.jsp;
 
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import java.util.*;
 
public class ShowNames_jsp extends HttpJspBase {
 
 
  private static java.util.Vector _jspx_includes;
 
  public java.util.List getIncludes() {
    return _jspx_includes;
  }
 
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {
 
    JspFactory _jspxFactory = null;
    javax.servlet.jsp.PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
 
 
    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=ISO-8859-1");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;
 
      out.write("\r\n\r\n");
      out.write("\r\n");
      out.write("\r\n\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<HTML>\r\n");
      out.write("<HEAD>\r\n");
      out.write("<TITLE>Showing Objects from a Session");
      out.write("</TITLE>\r\n");
      out.write("</HEAD>\r\n");
      out.write("<BODY BGCOLOR=\"#E0FFFF\">\r\n");
      out.write("<H1>");
      out.write("<CENTER>Showing Objects from a Session");
      out.write("</CENTER>");
      out.write("</H1>\r\n\r\n");
 
 
Vector UserSession = ( Vector ) session.getAttribute( "users" );
Integer xCount = (Integer) session.getAttribute("count");
 
 
      out.write("\r\n\r\nNumber of names: ");
      out.print(xCount.intValue());
      out.write("\r\n\r\n");
      out.write("<BR>\r\n\r\n");
 
 
for ( int i = 0; i < UserSession.size() ; i ++ )
{ 
      out.write("\r\n");
      out.print( ( String ) UserSession.elementAt ( i ));
      out.write("\r\n");
 }  
      out.write("\r\n\r\n");
      out.write("</BODY>\r\n");
      out.write("</HTML>");
    } catch (Throwable t) {
      out = _jspx_out;
      if (out != null && out.getBufferSize() != 0)
        out.clearBuffer();
      if (pageContext != null) pageContext.handlePageException(t);
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
}


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Apache Tomcat Posted: Aug 23, 2003 7:46 AM
Reply to this message Reply
The error "package org.apache.jasper.runtime does not exist" is probably coming from a problem with your tomcat setup. The classpath at runtime is not finding the org.apache.jasper.runtime package.

Suggest reinstalling your tomcat and checking any installation notes for your operating system.

The code you posted looks like the results of a jsp compiled page.

You should post the jsp code.

Try the examples in the default tomcat installation and see if they are working.

Flat View: This topic has 1 reply on 1 page
Topic: jsp & applet param Previous Topic   Next Topic Topic: Null Pointer Exception

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use