Is 'testClass' a valid class?
Is it accessible to your JSPs?
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html
Have you imported it to the JSP?
<%@ page import="package.class" %>
If you're new to Java/JSP, you'll probably save yourself a lot of
headaches by finding either a JSP/Servlet book or an online tutorial.
There are hundreds out there (GIYF).
Also, your naming/capitalization convention hints that you are new to
Java as well. Like with JSP/Servlets, there are lots of books and
tutorials on Java available.
On the surface, JSPs look a lot like PHP or ASP pages but there are some
critical concepts (threading being on the top of the list) that you
should understand before writing any production code with them.
Best of Luck,
-Ben
On Wed, 2004-12-22 at 15:14, Charles P. Killmer wrote:
> Thanks I got that working. Another thing though.
>
> <%@ include file="file.jsp"%>
> <%!
> public String test() {
> testClass temp = new testClass();
> }
> Test();
> %>
>
> This results in an error about testClass being an invalid type. Any
> idea how I can use the testClass that is defined in file.jsp within this
> test function?
>
> Thank you
> Charles Killmer
>
>
>
> -----Original Message-----
> From: Ben Souther [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 22, 2004 1:10 PM
> To: Tomcat Users List
> Subject: Re: Scripts
>
> try:
>
> <%!
> public String test(){
> return "test";
> }
> %>
>
>
> Note the exclamation point in the tag..
>
>
> On Wed, 2004-12-22 at 14:05, Charles P. Killmer wrote:
> > I am trying to write a function in a script file and having a lot of
> > trouble.
> >
> > <%
> > function String test() {
> > return "test";
> > }
> > out.print(test());
> > %>
> >
> > Is there a way to do this without using a class? Also along these
> > lines would something like this be possible.
> >
> > <%
> > function void test() {
> > %>
> > This should just be echoed to the screen.
> > <%
> > }
> > test();
> > %>
> >
> > Thanks for any help
> > Charles Killmer
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]