Irene,
Test if your servlet is running stand-alone. You should be able to test
it with URL: http://host/jetspeed/FormTest.
Your question:
a) If you define your class, FormTest, in a package called "myfolder"
then the class file must be in <jetspeed>/WEB-INF/classes/myfolder, and
in step 2, you need to change the servlet-class to:
<servlet-class>
myfolder.FormTest
</servlet-class>
b) If you want to change the URL of your servlet to, say,
/myservlets/FormTest, then you need to change the url-pattern in step 2
to
<url-pattern>
/myservlets/FormTest
</url-pattern>
and change your servlet entry so it reflects the change:
<parameter name="url" value="/myservlets/FormTest"
hidden="false"/>
a) and b) do not depend on each other because of the servlet mappings in
web.xml.
Did you change FormTest.java file? If so, you can send it to me. I can
take a look at it.
Ozgur
> -----Original Message-----
> From: Irene Huang [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 9:43 PM
> To: Jetspeed user
> Subject: Servlet as a portlet?
>
> Hello,
>
> I was tring to add a servlet to work as a portlet in Jetspeed 1.3a2
(don't
> really know how to write a portlet..)
> I can see it on the portlet list. But after I click add portlet, the
> portlet
> didn't show up.
>
> ***Here are my steps, please take a look:***
>
> 1. put the "FormTest.class" in <jetspeed>/WEB-INF/classes/
>
> Q: Can I create a folder "Servlet" and put my servlet class there?
> If I did, What will be the needed modification in step 2 and 3?
>
>
> 2. add following in <jetspeed>/WEB-INF/web.xml
> <servlet>
> <servlet-name>
> FormTest
> </servlet-name>
> <servlet-class>
> FormTest
> </servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>
> FormTest
> </servlet-name>
> <url-pattern>
> /FormTest
> </url-pattern>
> </servlet-mapping>
>
> 3. add following in <jetspeed>\WEB-INF\conf\xxx.xreg
> <portlet-entry name="Servlet" hidden="false" type="abstract"
> application="false">
>
>
> <classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet
> </classname>
> </portlet-entry>
> <portlet-entry name="FormTestServlet" hidden="false" type="ref"
> parent="Servlet" application="false">
> <meta-info>
> <title>FormTest Servlet</title>
> <description>FormTest Servlet</description>
> </meta-info>
> <parameter name="url" value="/FormTest" hidden="false"/>
> <media-type ref="html"/>
> </portlet-entry>
>
>
> Thank you for your help!!
>
>
> Irene
>
>
> --
> To unsubscribe, e-mail: <mailto:jetspeed-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:jetspeed-user-
> [EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>