You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Gopi Kandaswamy <gk...@cs.indiana.edu> on 2002/02/01 14:44:48 UTC

How to make a servlet display a message as a portlet

I am new to jetspeed and have a simple question. How to run a servlet within 
jetspeed. 

I have a simple servlet to start with, i.e the HelloWorld servlet. I did the 
following but still cannot get the servlet to print the message "HelloWorld" 
when I make it a portlet. But it prints the message "HelloWorld" when I 
access it as a servlet.

1. I compiled the servlet and put the class file in jetspeed/WEB-INF/classes.
2. I added the following entry in the jetspeed/WEB-INF/conf/portlets.xreg file

<portlet-entry name="Servlet" hidden="false" type="abstract" 
application="false">        
<classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</classname>
</portlet-entry>

<portlet-entry name="HelloWorld" hidden="false" type="ref"
        parent="Servlet" application="false">
        <meta-info>
            <title>Hello World Servlet</title>
            <description>This is my Hello World Servlet</description>
        </meta-info>
        <media-type ref="html"/>
        <url>/servlet/HelloWorld</url>
</portlet-entry>

3. I added the following entry to my jetspeed/WEB-INF/web.xml file 

 <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <display-name>Hello World Servlet</display-name>
    <description>no description</description>
    <servlet-class>HelloWorld</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/servlet/HelloWorld</url-pattern>
  </servlet-mapping>

Any help would be greatly appreciated.

Thanks

Gopi


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to make a servlet display a message as a portlet

Posted by Gopi Kandaswamy <gk...@cs.indiana.edu>.
Hi,

Actually it did work!!!. 

But the portlet prints "HelloWorld" only after I run the servlet as 
http://localhost:8080/jetspeed/servlet/HelloWorld. Why does the portlet not 
run the servlet automatically when I refresh the page. Is there any way I can 
solve this problem. May be my understanding of how jetspeed works is wrong.

Thanks for your help.

Gopi


On Friday 01 February 2002 04:19 pm, you wrote:
> I am sorry, but it did not solve the problem.
>
> 1. Added the following entry in jetspeed/WEB-INF/web.xml
>
>        <servlet>
>         <servlet-name>HelloWorld</servlet-name>
>         <display-name>Hello World Servlet</display-name>
>         <description>no description</description>
>         <servlet-class>HelloWorld</servlet-class>
>        </servlet>
>
>         <servlet-mapping>
>         <servlet-name>HelloWorld</servlet-name>
>         <url-pattern>/servlet/HelloWorld</url-pattern>
>         </servlet-mapping>
>
> 2. Added the following to jetspeed/WEB-INF/conf/portlets.xreg
>
>   <portlet-entry name="Servlet" hidden="false" type="abstract"
> application="false">
>
> <classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</class
>name> </portlet-entry>
>     <portlet-entry name="HelloWorld" hidden="false" type="ref"
>         parent="Servlet" application="false">
>         <meta-info>
>             <title>Hello World Servlet</title>
>             <description>This is my Hello World Servlet</description>
>         </meta-info>
>         <parameter name="url" value="/servlet/HelloWorld" hidden="false"/>
>         <media-type ref="html"/>
>     </portlet-entry>
>
> I also put the HelloWorld.class in the jetspeed/WEB-INF/classes/servlet
> directory and restarted and did all such things. I also put it in the
> classes directory and changed the url value accordingly. Still, I can see
> the portlet but there is nothing in it. It does not print hello world. On
> the other hand if the servlet is accessed like a servlet, it prints hello
> world.
>
> Thanks a lot
>
> Gopi
>
> On Friday 01 February 2002 03:46 pm, you wrote:
> > Gopi,
> > Did this solve the problem?
> >
> >
> > Paul Spencer
> >
> > Ozgur Balsoy wrote:
> > > Gopi,
> > >
> > > I am sorry that it was my mistake. The portlet entry must be like this:
> > >
> > > <portlet-entry name="HelloWorld" hidden="false" type="ref"
> > >          parent="Servlet" application="false">
> > >          <meta-info>
> > >              <title>Hello World Servlet</title>
> > >              <description>This is my Hello World Servlet</description>
> > >          </meta-info>
> > > 	   <parameter name="url" value="/servlet/HelloWorld" />
> > >          <media-type ref="html"/>
> > > </portlet-entry>
> > >
> > > Don't forget that HelloWorld.class must be in classes/servlet/
> > > directory. If you put it in classes/ then the url becomes /HelloWorld
> > >
> > > Ozgur
> > >
> > > -----Original Message-----
> > > From: Gopi Kandaswamy [mailto:gkandasw@cs.indiana.edu]
> > > Sent: Friday, February 01, 2002 2:44 PM
> > > To: Jetspeed Users List
> > > Subject: Re: How to make a servlet display a message as a portlet
> > >
> > > Hi Paul,
> > >
> > > I can see only one message and it does not seem to be an error message.
> > > I
> > > found it in the jetspeed/WEB-INF/log/jetspeed.log. There are no
> > > relevant
> > >
> > > messages elswhere.
> > >
> > > [Fri Feb 01 13:45:57 EST 2002] -- DEBUG -- Adding entry HelloWorld of
> > > class
> > > class org.apache.jetspeed.services.registry.NormalizedPortletEntry to
> > > registry Registry
> > >
> > > I have the servlet.jar also in the jetpseed/WEB-INF/classes directory.
> > > I am
> > > using Tomcat 4.0.1 and Jetspeed 1.3a2 on Red Hat Linux 7.2 and jdk1.3.
> > >
> > > Also I deleted the HelloWorld.class from the jetspeed/WEB-INF/classes
> > > directory and restarted Tomcat. I got no error messages. So looks like
> > > the
> > > HelloWorld.class file is not being read/accessed at all by the
> > > portlets.
> > >
> > > Thanks a lot. I really hope I can be helped.
> > >
> > > Gopi
> > >
> > > On Friday 01 February 2002 13:58, you wrote:
> > >>Gopi,
> > >>
> > >>Are their any message in the Jetspeed log file, Tomcat log files,
> > >>standard output?
> > >>
> > >>Paul Spencer
> > >>
> > >>Gopi Kandaswamy wrote:
> > >>>I am new to jetspeed and have a simple question. How to run a
> > >
> > > servlet
> > >
> > >>>within jetspeed.
> > >>>
> > >>>I have a simple servlet to start with, i.e the HelloWorld servlet. I
> > >
> > > did
> > >
> > >>>the following but still cannot get the servlet to print the message
> > >>>"HelloWorld" when I make it a portlet. But it prints the message
> > >>>"HelloWorld" when I access it as a servlet.
> > >>>
> > >>>1. I compiled the servlet and put the class file in
> > >>>jetspeed/WEB-INF/classes. 2. I added the following entry in the
> > >>>jetspeed/WEB-INF/conf/portlets.xreg file
> > >>>
> > >>><portlet-entry name="Servlet" hidden="false" type="abstract"
> > >>>application="false">
> > >
> > > <classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</c
> > >l a
> > >
> > >>>ssname> </portlet-entry>
> > >>>
> > >>><portlet-entry name="HelloWorld" hidden="false" type="ref"
> > >>>        parent="Servlet" application="false">
> > >>>        <meta-info>
> > >>>            <title>Hello World Servlet</title>
> > >>>            <description>This is my Hello World
> > >
> > > Servlet</description>
> > >
> > >>>        </meta-info>
> > >>>        <media-type ref="html"/>
> > >>>        <url>/servlet/HelloWorld</url>
> > >>></portlet-entry>
> > >>>
> > >>>3. I added the following entry to my jetspeed/WEB-INF/web.xml file
> > >>>
> > >>> <servlet>
> > >>>    <servlet-name>HelloWorld</servlet-name>
> > >>>    <display-name>Hello World Servlet</display-name>
> > >>>    <description>no description</description>
> > >>>    <servlet-class>HelloWorld</servlet-class>
> > >>>  </servlet>
> > >>>
> > >>>  <servlet-mapping>
> > >>>    <servlet-name>HelloWorld</servlet-name>
> > >>>    <url-pattern>/servlet/HelloWorld</url-pattern>
> > >>>  </servlet-mapping>
> > >>>
> > >>>Any help would be greatly appreciated.
> > >>>
> > >>>Thanks
> > >>>
> > >>>Gopi
> > >>>
> > >>>
> > >>>--
> > >>>To unsubscribe, e-mail:
> > >>><ma...@jakarta.apache.org> For additional
> > >>>commands, e-mail: <ma...@jakarta.apache.org>
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org> For additional
> > > commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to make a servlet display a message as a portlet

Posted by Gopi Kandaswamy <gk...@cs.indiana.edu>.
I am sorry, but it did not solve the problem. 

1. Added the following entry in jetspeed/WEB-INF/web.xml

       <servlet>
        <servlet-name>HelloWorld</servlet-name>
        <display-name>Hello World Servlet</display-name>
        <description>no description</description>
        <servlet-class>HelloWorld</servlet-class>
       </servlet>

        <servlet-mapping>
        <servlet-name>HelloWorld</servlet-name>
        <url-pattern>/servlet/HelloWorld</url-pattern>
        </servlet-mapping>

2. Added the following to jetspeed/WEB-INF/conf/portlets.xreg

  <portlet-entry name="Servlet" hidden="false" type="abstract" 
application="false">
        
<classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</classname>
    </portlet-entry>
    <portlet-entry name="HelloWorld" hidden="false" type="ref"
        parent="Servlet" application="false">
        <meta-info>
            <title>Hello World Servlet</title>
            <description>This is my Hello World Servlet</description>
        </meta-info>
        <parameter name="url" value="/servlet/HelloWorld" hidden="false"/>
        <media-type ref="html"/>
    </portlet-entry>

I also put the HelloWorld.class in the jetspeed/WEB-INF/classes/servlet 
directory and restarted and did all such things. I also put it in the classes 
directory and changed the url value accordingly. Still, I can see the portlet 
but there is nothing in it. It does not print hello world. On the other hand 
if the servlet is accessed like a servlet, it prints hello world.

Thanks a lot

Gopi

On Friday 01 February 2002 03:46 pm, you wrote:
> Gopi,
> Did this solve the problem?
>
>
> Paul Spencer
>
> Ozgur Balsoy wrote:
> > Gopi,
> >
> > I am sorry that it was my mistake. The portlet entry must be like this:
> >
> > <portlet-entry name="HelloWorld" hidden="false" type="ref"
> >          parent="Servlet" application="false">
> >          <meta-info>
> >              <title>Hello World Servlet</title>
> >              <description>This is my Hello World Servlet</description>
> >          </meta-info>
> > 	   <parameter name="url" value="/servlet/HelloWorld" />
> >          <media-type ref="html"/>
> > </portlet-entry>
> >
> > Don't forget that HelloWorld.class must be in classes/servlet/
> > directory. If you put it in classes/ then the url becomes /HelloWorld
> >
> > Ozgur
> >
> > -----Original Message-----
> > From: Gopi Kandaswamy [mailto:gkandasw@cs.indiana.edu]
> > Sent: Friday, February 01, 2002 2:44 PM
> > To: Jetspeed Users List
> > Subject: Re: How to make a servlet display a message as a portlet
> >
> > Hi Paul,
> >
> > I can see only one message and it does not seem to be an error message.
> > I
> > found it in the jetspeed/WEB-INF/log/jetspeed.log. There are no relevant
> >
> > messages elswhere.
> >
> > [Fri Feb 01 13:45:57 EST 2002] -- DEBUG -- Adding entry HelloWorld of
> > class
> > class org.apache.jetspeed.services.registry.NormalizedPortletEntry to
> > registry Registry
> >
> > I have the servlet.jar also in the jetpseed/WEB-INF/classes directory. I
> > am
> > using Tomcat 4.0.1 and Jetspeed 1.3a2 on Red Hat Linux 7.2 and jdk1.3.
> >
> > Also I deleted the HelloWorld.class from the jetspeed/WEB-INF/classes
> > directory and restarted Tomcat. I got no error messages. So looks like
> > the
> > HelloWorld.class file is not being read/accessed at all by the portlets.
> >
> > Thanks a lot. I really hope I can be helped.
> >
> > Gopi
> >
> > On Friday 01 February 2002 13:58, you wrote:
> >>Gopi,
> >>
> >>Are their any message in the Jetspeed log file, Tomcat log files,
> >>standard output?
> >>
> >>Paul Spencer
> >>
> >>Gopi Kandaswamy wrote:
> >>>I am new to jetspeed and have a simple question. How to run a
> >
> > servlet
> >
> >>>within jetspeed.
> >>>
> >>>I have a simple servlet to start with, i.e the HelloWorld servlet. I
> >
> > did
> >
> >>>the following but still cannot get the servlet to print the message
> >>>"HelloWorld" when I make it a portlet. But it prints the message
> >>>"HelloWorld" when I access it as a servlet.
> >>>
> >>>1. I compiled the servlet and put the class file in
> >>>jetspeed/WEB-INF/classes. 2. I added the following entry in the
> >>>jetspeed/WEB-INF/conf/portlets.xreg file
> >>>
> >>><portlet-entry name="Servlet" hidden="false" type="abstract"
> >>>application="false">
> >
> > <classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</cl
> > a
> >
> >>>ssname> </portlet-entry>
> >>>
> >>><portlet-entry name="HelloWorld" hidden="false" type="ref"
> >>>        parent="Servlet" application="false">
> >>>        <meta-info>
> >>>            <title>Hello World Servlet</title>
> >>>            <description>This is my Hello World
> >
> > Servlet</description>
> >
> >>>        </meta-info>
> >>>        <media-type ref="html"/>
> >>>        <url>/servlet/HelloWorld</url>
> >>></portlet-entry>
> >>>
> >>>3. I added the following entry to my jetspeed/WEB-INF/web.xml file
> >>>
> >>> <servlet>
> >>>    <servlet-name>HelloWorld</servlet-name>
> >>>    <display-name>Hello World Servlet</display-name>
> >>>    <description>no description</description>
> >>>    <servlet-class>HelloWorld</servlet-class>
> >>>  </servlet>
> >>>
> >>>  <servlet-mapping>
> >>>    <servlet-name>HelloWorld</servlet-name>
> >>>    <url-pattern>/servlet/HelloWorld</url-pattern>
> >>>  </servlet-mapping>
> >>>
> >>>Any help would be greatly appreciated.
> >>>
> >>>Thanks
> >>>
> >>>Gopi
> >>>
> >>>
> >>>--
> >>>To unsubscribe, e-mail:
> >>><ma...@jakarta.apache.org> For additional
> >>>commands, e-mail: <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to make a servlet display a message as a portlet

Posted by Paul Spencer <pa...@apache.org>.
Gopi,
Did this solve the problem?


Paul Spencer

Ozgur Balsoy wrote:

> Gopi,
> 
> I am sorry that it was my mistake. The portlet entry must be like this:
> 
> <portlet-entry name="HelloWorld" hidden="false" type="ref"
>          parent="Servlet" application="false">
>          <meta-info>
>              <title>Hello World Servlet</title>
>              <description>This is my Hello World Servlet</description>
>          </meta-info>
> 	   <parameter name="url" value="/servlet/HelloWorld" />
>          <media-type ref="html"/>
> </portlet-entry>
> 
> Don't forget that HelloWorld.class must be in classes/servlet/
> directory. If you put it in classes/ then the url becomes /HelloWorld
> 
> Ozgur
> 
> -----Original Message-----
> From: Gopi Kandaswamy [mailto:gkandasw@cs.indiana.edu] 
> Sent: Friday, February 01, 2002 2:44 PM
> To: Jetspeed Users List
> Subject: Re: How to make a servlet display a message as a portlet
> 
> Hi Paul,
> 
> I can see only one message and it does not seem to be an error message.
> I 
> found it in the jetspeed/WEB-INF/log/jetspeed.log. There are no relevant
> 
> messages elswhere.
> 
> [Fri Feb 01 13:45:57 EST 2002] -- DEBUG -- Adding entry HelloWorld of
> class 
> class org.apache.jetspeed.services.registry.NormalizedPortletEntry to 
> registry Registry
> 
> I have the servlet.jar also in the jetpseed/WEB-INF/classes directory. I
> am 
> using Tomcat 4.0.1 and Jetspeed 1.3a2 on Red Hat Linux 7.2 and jdk1.3.
> 
> Also I deleted the HelloWorld.class from the jetspeed/WEB-INF/classes 
> directory and restarted Tomcat. I got no error messages. So looks like
> the 
> HelloWorld.class file is not being read/accessed at all by the portlets.
> 
> Thanks a lot. I really hope I can be helped.
> 
> Gopi
> 
> 
> 
> On Friday 01 February 2002 13:58, you wrote:
> 
>>Gopi,
>>
>>Are their any message in the Jetspeed log file, Tomcat log files,
>>standard output?
>>
>>Paul Spencer
>>
>>Gopi Kandaswamy wrote:
>>
>>>I am new to jetspeed and have a simple question. How to run a
>>>
> servlet
> 
>>>within jetspeed.
>>>
>>>I have a simple servlet to start with, i.e the HelloWorld servlet. I
>>>
> did
> 
>>>the following but still cannot get the servlet to print the message
>>>"HelloWorld" when I make it a portlet. But it prints the message
>>>"HelloWorld" when I access it as a servlet.
>>>
>>>1. I compiled the servlet and put the class file in
>>>jetspeed/WEB-INF/classes. 2. I added the following entry in the
>>>jetspeed/WEB-INF/conf/portlets.xreg file
>>>
>>><portlet-entry name="Servlet" hidden="false" type="abstract"
>>>application="false">
>>>
> <classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</cl
> a
> 
>>>ssname> </portlet-entry>
>>>
>>><portlet-entry name="HelloWorld" hidden="false" type="ref"
>>>        parent="Servlet" application="false">
>>>        <meta-info>
>>>            <title>Hello World Servlet</title>
>>>            <description>This is my Hello World
>>>
> Servlet</description>
> 
>>>        </meta-info>
>>>        <media-type ref="html"/>
>>>        <url>/servlet/HelloWorld</url>
>>></portlet-entry>
>>>
>>>3. I added the following entry to my jetspeed/WEB-INF/web.xml file
>>>
>>> <servlet>
>>>    <servlet-name>HelloWorld</servlet-name>
>>>    <display-name>Hello World Servlet</display-name>
>>>    <description>no description</description>
>>>    <servlet-class>HelloWorld</servlet-class>
>>>  </servlet>
>>>
>>>  <servlet-mapping>
>>>    <servlet-name>HelloWorld</servlet-name>
>>>    <url-pattern>/servlet/HelloWorld</url-pattern>
>>>  </servlet-mapping>
>>>
>>>Any help would be greatly appreciated.
>>>
>>>Thanks
>>>
>>>Gopi
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:  
>>><ma...@jakarta.apache.org> For additional
>>>commands, e-mail: <ma...@jakarta.apache.org>
>>>
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How to make a servlet display a message as a portlet

Posted by Ozgur Balsoy <ba...@grids.ucs.indiana.edu>.
Gopi,

I am sorry that it was my mistake. The portlet entry must be like this:

<portlet-entry name="HelloWorld" hidden="false" type="ref"
         parent="Servlet" application="false">
         <meta-info>
             <title>Hello World Servlet</title>
             <description>This is my Hello World Servlet</description>
         </meta-info>
	   <parameter name="url" value="/servlet/HelloWorld" />
         <media-type ref="html"/>
</portlet-entry>

Don't forget that HelloWorld.class must be in classes/servlet/
directory. If you put it in classes/ then the url becomes /HelloWorld

Ozgur

-----Original Message-----
From: Gopi Kandaswamy [mailto:gkandasw@cs.indiana.edu] 
Sent: Friday, February 01, 2002 2:44 PM
To: Jetspeed Users List
Subject: Re: How to make a servlet display a message as a portlet

Hi Paul,

I can see only one message and it does not seem to be an error message.
I 
found it in the jetspeed/WEB-INF/log/jetspeed.log. There are no relevant

messages elswhere.

[Fri Feb 01 13:45:57 EST 2002] -- DEBUG -- Adding entry HelloWorld of
class 
class org.apache.jetspeed.services.registry.NormalizedPortletEntry to 
registry Registry

I have the servlet.jar also in the jetpseed/WEB-INF/classes directory. I
am 
using Tomcat 4.0.1 and Jetspeed 1.3a2 on Red Hat Linux 7.2 and jdk1.3.

Also I deleted the HelloWorld.class from the jetspeed/WEB-INF/classes 
directory and restarted Tomcat. I got no error messages. So looks like
the 
HelloWorld.class file is not being read/accessed at all by the portlets.

Thanks a lot. I really hope I can be helped.

Gopi



On Friday 01 February 2002 13:58, you wrote:
> Gopi,
>
> Are their any message in the Jetspeed log file, Tomcat log files,
> standard output?
>
> Paul Spencer
>
> Gopi Kandaswamy wrote:
> > I am new to jetspeed and have a simple question. How to run a
servlet
> > within jetspeed.
> >
> > I have a simple servlet to start with, i.e the HelloWorld servlet. I
did
> > the following but still cannot get the servlet to print the message
> > "HelloWorld" when I make it a portlet. But it prints the message
> > "HelloWorld" when I access it as a servlet.
> >
> > 1. I compiled the servlet and put the class file in
> > jetspeed/WEB-INF/classes. 2. I added the following entry in the
> > jetspeed/WEB-INF/conf/portlets.xreg file
> >
> > <portlet-entry name="Servlet" hidden="false" type="abstract"
> > application="false">
> >
<classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</cl
a
> >ssname> </portlet-entry>
> >
> > <portlet-entry name="HelloWorld" hidden="false" type="ref"
> >         parent="Servlet" application="false">
> >         <meta-info>
> >             <title>Hello World Servlet</title>
> >             <description>This is my Hello World
Servlet</description>
> >         </meta-info>
> >         <media-type ref="html"/>
> >         <url>/servlet/HelloWorld</url>
> > </portlet-entry>
> >
> > 3. I added the following entry to my jetspeed/WEB-INF/web.xml file
> >
> >  <servlet>
> >     <servlet-name>HelloWorld</servlet-name>
> >     <display-name>Hello World Servlet</display-name>
> >     <description>no description</description>
> >     <servlet-class>HelloWorld</servlet-class>
> >   </servlet>
> >
> >   <servlet-mapping>
> >     <servlet-name>HelloWorld</servlet-name>
> >     <url-pattern>/servlet/HelloWorld</url-pattern>
> >   </servlet-mapping>
> >
> > Any help would be greatly appreciated.
> >
> > Thanks
> >
> > Gopi
> >
> >
> > --
> > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How to make a servlet display a message as a portlet

Posted by Ozgur Balsoy <ba...@grids.ucs.indiana.edu>.
This is the error message from jetspeed/WEB-INF/logs/jetspeed.log:

[Fri Feb 01 14:55:27 EST 2002] -- ERROR -- EcsServletElement: Could not
include the following URL: null : null
	Exception:  java.lang.NullPointerException
	Stack Trace follows:
	java.lang.NullPointerException
	at
commgrids.jetspeed.util.servlet.EcsServletElement.output(EcsServletEleme
nt.java:132)
	at
commgrids.jetspeed.util.servlet.EcsServletElement.output(EcsServletEleme
nt.java:112)


Even if there is <url> tag in the portlet entry, it still throws this
error.

Ozgur

-----Original Message-----
From: Gopi Kandaswamy [mailto:gkandasw@cs.indiana.edu] 
Sent: Friday, February 01, 2002 2:44 PM
To: Jetspeed Users List
Subject: Re: How to make a servlet display a message as a portlet

Hi Paul,

I can see only one message and it does not seem to be an error message.
I 
found it in the jetspeed/WEB-INF/log/jetspeed.log. There are no relevant

messages elswhere.

[Fri Feb 01 13:45:57 EST 2002] -- DEBUG -- Adding entry HelloWorld of
class 
class org.apache.jetspeed.services.registry.NormalizedPortletEntry to 
registry Registry

I have the servlet.jar also in the jetpseed/WEB-INF/classes directory. I
am 
using Tomcat 4.0.1 and Jetspeed 1.3a2 on Red Hat Linux 7.2 and jdk1.3.

Also I deleted the HelloWorld.class from the jetspeed/WEB-INF/classes 
directory and restarted Tomcat. I got no error messages. So looks like
the 
HelloWorld.class file is not being read/accessed at all by the portlets.

Thanks a lot. I really hope I can be helped.

Gopi



On Friday 01 February 2002 13:58, you wrote:
> Gopi,
>
> Are their any message in the Jetspeed log file, Tomcat log files,
> standard output?
>
> Paul Spencer
>
> Gopi Kandaswamy wrote:
> > I am new to jetspeed and have a simple question. How to run a
servlet
> > within jetspeed.
> >
> > I have a simple servlet to start with, i.e the HelloWorld servlet. I
did
> > the following but still cannot get the servlet to print the message
> > "HelloWorld" when I make it a portlet. But it prints the message
> > "HelloWorld" when I access it as a servlet.
> >
> > 1. I compiled the servlet and put the class file in
> > jetspeed/WEB-INF/classes. 2. I added the following entry in the
> > jetspeed/WEB-INF/conf/portlets.xreg file
> >
> > <portlet-entry name="Servlet" hidden="false" type="abstract"
> > application="false">
> >
<classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</cl
a
> >ssname> </portlet-entry>
> >
> > <portlet-entry name="HelloWorld" hidden="false" type="ref"
> >         parent="Servlet" application="false">
> >         <meta-info>
> >             <title>Hello World Servlet</title>
> >             <description>This is my Hello World
Servlet</description>
> >         </meta-info>
> >         <media-type ref="html"/>
> >         <url>/servlet/HelloWorld</url>
> > </portlet-entry>
> >
> > 3. I added the following entry to my jetspeed/WEB-INF/web.xml file
> >
> >  <servlet>
> >     <servlet-name>HelloWorld</servlet-name>
> >     <display-name>Hello World Servlet</display-name>
> >     <description>no description</description>
> >     <servlet-class>HelloWorld</servlet-class>
> >   </servlet>
> >
> >   <servlet-mapping>
> >     <servlet-name>HelloWorld</servlet-name>
> >     <url-pattern>/servlet/HelloWorld</url-pattern>
> >   </servlet-mapping>
> >
> > Any help would be greatly appreciated.
> >
> > Thanks
> >
> > Gopi
> >
> >
> > --
> > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to make a servlet display a message as a portlet

Posted by Gopi Kandaswamy <gk...@cs.indiana.edu>.
Hi Paul,

I can see only one message and it does not seem to be an error message. I 
found it in the jetspeed/WEB-INF/log/jetspeed.log. There are no relevant 
messages elswhere.

[Fri Feb 01 13:45:57 EST 2002] -- DEBUG -- Adding entry HelloWorld of class 
class org.apache.jetspeed.services.registry.NormalizedPortletEntry to 
registry Registry

I have the servlet.jar also in the jetpseed/WEB-INF/classes directory. I am 
using Tomcat 4.0.1 and Jetspeed 1.3a2 on Red Hat Linux 7.2 and jdk1.3.

Also I deleted the HelloWorld.class from the jetspeed/WEB-INF/classes 
directory and restarted Tomcat. I got no error messages. So looks like the 
HelloWorld.class file is not being read/accessed at all by the portlets.

Thanks a lot. I really hope I can be helped.

Gopi



On Friday 01 February 2002 13:58, you wrote:
> Gopi,
>
> Are their any message in the Jetspeed log file, Tomcat log files,
> standard output?
>
> Paul Spencer
>
> Gopi Kandaswamy wrote:
> > I am new to jetspeed and have a simple question. How to run a servlet
> > within jetspeed.
> >
> > I have a simple servlet to start with, i.e the HelloWorld servlet. I did
> > the following but still cannot get the servlet to print the message
> > "HelloWorld" when I make it a portlet. But it prints the message
> > "HelloWorld" when I access it as a servlet.
> >
> > 1. I compiled the servlet and put the class file in
> > jetspeed/WEB-INF/classes. 2. I added the following entry in the
> > jetspeed/WEB-INF/conf/portlets.xreg file
> >
> > <portlet-entry name="Servlet" hidden="false" type="abstract"
> > application="false">
> > <classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</cla
> >ssname> </portlet-entry>
> >
> > <portlet-entry name="HelloWorld" hidden="false" type="ref"
> >         parent="Servlet" application="false">
> >         <meta-info>
> >             <title>Hello World Servlet</title>
> >             <description>This is my Hello World Servlet</description>
> >         </meta-info>
> >         <media-type ref="html"/>
> >         <url>/servlet/HelloWorld</url>
> > </portlet-entry>
> >
> > 3. I added the following entry to my jetspeed/WEB-INF/web.xml file
> >
> >  <servlet>
> >     <servlet-name>HelloWorld</servlet-name>
> >     <display-name>Hello World Servlet</display-name>
> >     <description>no description</description>
> >     <servlet-class>HelloWorld</servlet-class>
> >   </servlet>
> >
> >   <servlet-mapping>
> >     <servlet-name>HelloWorld</servlet-name>
> >     <url-pattern>/servlet/HelloWorld</url-pattern>
> >   </servlet-mapping>
> >
> > Any help would be greatly appreciated.
> >
> > Thanks
> >
> > Gopi
> >
> >
> > --
> > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How to make a servlet display a message as a portlet

Posted by Irene Huang <ih...@acegain.com>.
Dear all,

How to access a "servlet"?
I compiled the servlet and put the class file in jetspeed/WEB-INF/classes.
and then go to http://localhost:8080/jetspeed/ServletTest

the output:

Apache Tomcat/4.0.1 - HTTP Status 404 - /ServletTest
----------------------------------------------------------------------------
----
type Status report
message /ServletTest
description The requested resource (/ServletTest) is not available.

Q: Can someone please explain how to access servlet in Jetspeed? the
directory?
     How and which files that needed to be created/modified?


Thank you lots!!

Irene


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to make a servlet display a message as a portlet

Posted by Paul Spencer <pa...@apache.org>.
Gopi,

Are their any message in the Jetspeed log file, Tomcat log files, 
standard output?

Paul Spencer


Gopi Kandaswamy wrote:

> I am new to jetspeed and have a simple question. How to run a servlet within 
> jetspeed. 
> 
> I have a simple servlet to start with, i.e the HelloWorld servlet. I did the 
> following but still cannot get the servlet to print the message "HelloWorld" 
> when I make it a portlet. But it prints the message "HelloWorld" when I 
> access it as a servlet.
> 
> 1. I compiled the servlet and put the class file in jetspeed/WEB-INF/classes.
> 2. I added the following entry in the jetspeed/WEB-INF/conf/portlets.xreg file
> 
> <portlet-entry name="Servlet" hidden="false" type="abstract" 
> application="false">        
> <classname>org.apache.jetspeed.portal.portlets.ServletInvokerPortlet</classname>
> </portlet-entry>
> 
> <portlet-entry name="HelloWorld" hidden="false" type="ref"
>         parent="Servlet" application="false">
>         <meta-info>
>             <title>Hello World Servlet</title>
>             <description>This is my Hello World Servlet</description>
>         </meta-info>
>         <media-type ref="html"/>
>         <url>/servlet/HelloWorld</url>
> </portlet-entry>
> 
> 3. I added the following entry to my jetspeed/WEB-INF/web.xml file 
> 
>  <servlet>
>     <servlet-name>HelloWorld</servlet-name>
>     <display-name>Hello World Servlet</display-name>
>     <description>no description</description>
>     <servlet-class>HelloWorld</servlet-class>
>   </servlet>
> 
>   <servlet-mapping>
>     <servlet-name>HelloWorld</servlet-name>
>     <url-pattern>/servlet/HelloWorld</url-pattern>
>   </servlet-mapping>
> 
> Any help would be greatly appreciated.
> 
> Thanks
> 
> Gopi
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>