"xgj6688" wrote : let's make the question simple
  | I write a jsp page, and a helper class named test.class, I put the class 
into the web-inf/classes folder
  | In the jsp page, I want use the test.class.
  | but when I import the class in the jsp page: <@ page import="test" %>, I 
was told the import test can not be resolved.
  | How can I invoke my helper class in my jsp page?Why Jboss told me the 
helper class can not be resolved?

Here is a simple class and JSP that works (at least on JBoss 3.2.7):

Hello.java:

  | package peter;
  | public class Hello {
  |     public String toString() {
  |         return "hello to JBoss";
  |     }
  | }
  | 

index.jsp:

  | <html>
  | <body>
  | <%@ page import="peter.Hello" %>
  | <%
  |    Hello h = new Hello();
  | %>
  | <h1><%= h.toString() %></h1>
  | </body>
  | </html>
  | 

Note that I placed my class within a package.  When it was in the default 
package, the compiler complained that it did not know how to import Hello (it 
expected a dot).  Perhaps you should try placing your test class into a package 
and thus changing your import statement.

Hope this helps.



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3875466#3875466

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3875466


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to