Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-2007, 12:42 AM
Senior Member
 
Join Date: Jun 2007
Posts: 130
Jack is on a distinguished road
Description the server encountered an internal error
Hi,
I have a problem with the java beans and I can't resolve it

my code is:
javabean.jsp

Code:
<html> <head> <title>JavaBean example</title> </head> <body> <jsp:useBean id="m" scope="page" class="Message" /> <%m.showMessage("hi world");%> </body> </html>
I'm using tomcat 6.10.0 and this is the directory tree


webapps
practice
jsp
javabean.jsp
WEB-INF
classes
Message.class


this is the bean

Code:
public class Message { private String Message; public Message(String Message) { this.Message= new String(Message); } public void showMessage() { System.out.println(Message); } }
and the exception is:
Code:
description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: /jsp/javabean.jsp(6,0) The value for the useBean class attribute Mensaje is invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1155) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392) org.apache.jasper.compiler.Node$Root.accept(Node.java:489) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336) org.apache.jasper.compiler.Generator.generate(Generator.java:3394) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210) org.apache.jasper.compiler.Compiler.compile(Compiler.java:306) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.compiler.Compiler.compile(Compiler.java:273) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.
what is the problem????
any ideas?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-02-2007, 03:21 AM
Senior Member
 
Join Date: Jun 2007
Posts: 119
Peter is on a distinguished road
According to the error you can't use the Message class with this tag.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-02-2007, 03:24 AM
Ed Ed is offline
Senior Member
 
Join Date: Jun 2007
Posts: 110
Ed is on a distinguished road
I think that the problem is in the constructor:
try this
Code:
package version01; public class Message { private String message; public void Message(String message) { this.message= new String(message); } public String getMessage() { return message; } }
javabean.jsp

Code:
<jsp:useBean id="m" scope="page" class="version01.Message" /> <% m.setMessage("Hello"); %> <%=m.getMessage()%>
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat Server : Error filterStart kasipandian Web Frameworks 0 03-30-2008 04:50 PM
Eclipse's internal Tomcat vadimf Eclipse 0 02-14-2008 10:37 AM
Web-App server connection - How to hit the particular app server from the web server maruthi_s Enterprise JavaBeans 1 01-06-2008 01:32 PM
javac not recognized as an internal or external command kotoko New To Java 6 11-05-2007 01:39 PM
an internal error occurred during refresh christina Eclipse 1 08-06-2007 10:37 PM


All times are GMT +3. The time now is 04:12 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org