tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Haines <shai...@ipnet-solutions.com>
Subject RE: <jsp:useBean ...> from a servlet
Date Fri, 12 May 2000 19:51:58 GMT
I made two changes to the importing of my bean to match your working code:
(1) I moved the <useBean: ...> tag to inside the body of the HTML document
and (2) I changed the class="" parameter to type=""..

I no longer get the  "No bean "companies" available for  tag" error message,
instead I get the following on the tomcat debug window

java.lang.Error: Fatal Error: missing resource:
java.util.PropertyResourceBundle
        at org.apache.jasper.Constants.getString(Constants.java, Compiled
Code)
        at
org.apache.jasper.compiler.BeanGenerator.checkSyntax(BeanGenerator.java:121)
	  ...

So at least the errors are changing :)   Any other ideas??  Did you change
anything else?

Thanks,
Steve
-----Original Message-----
From: Jeff Holt [mailto:JeffH@vetsmart.com]
Sent: Friday, May 12, 2000 12:11 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: <jsp:useBean ...> from a servlet


OK I got mine working from help of Ed Dunkle. I have the following code
snippits, direct from working code:


Servlet:

public void doPost( HttpServletRequest request,
                      HttpServletResponse response)
                        throws ServletException, IOException {
    response.setContentType("text/html");
    
    if( request.getParameter( "addClient" ).equals( "fromJSP" )) {
      Client myClient = new Client( request, conn );

      request.setAttribute( "myClient", myClient );
      request.setAttribute( "testJeff", "Crap" );
      
      RequestDispatcher rd = getServletContext()
                              .getRequestDispatcher( "/viewClient.jsp");
      rd.forward( request, response );
    }

JSP:

<%@ page %>
<HTML>
<HEAD>
<TITLE>
Client Viewer
</TITLE>
</HEAD>
<BODY>
<H2>The following output is from JSP code:</H2>
<P>

<BR>
<jsp:useBean id="myClient" type="vetsmart.Client" scope="request" />

  <%= myClient.get( "firstname" ) %>
<BR>

</P>

<jsp:include page="debug.jsp"  flush="true" />

</BODY>
</HTML>


Hope this helps. Note case of useBean...

Jeff


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message