[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jetspeed-user
Subject:    Re: Full servlet style application as a portlet
From:       Aaron Andersen <aaron () ucar ! edu>
Date:       2001-07-30 21:19:56
[Download RAW message or body]

Chris,

Thanks for the info. However, I have tried changing the action
to /jetspeed. I then get a 404 not found. Do I need to add
somthing to the config of tomcat in server.xml?

-Aaron


Chris Kimpton wrote:
> 
> Hi,
> 
> --- Aaron Andersen <aaron@ucar.edu> wrote:
> > I've been digging through this list, the jakarta portlet catalog
> > and several other places but haven't been able to find an example
> > doing something similar to what I would like.
> >
> > What I want to do is write a Java class that extends
> > AbstractPortlet
> > or ApplicationPortlet. However, this class will call itself within
> > a
> > form element. A simple pared down code without all the method calls
> >
> > and imports follows. Is this possible or am I way off?
> > I've done similar things will servlets but can't seem to make it
> > work with portlets.
> >
> 
> This should be fine - we've done it with portlets.
> 
> > Thanks in advance for any help.
> >
> > public class JobSubmit extends AbstractPortlet
> > {
> >
> >     public ConcreteElement getContent(RunData data)
> >     {
> >         String text = null;
> >         String action = null;
> >         Boolean success;
> >
> >         ParameterParser params = data.getParameters();
> >         action = params.getString("action");
> >         if (action == null)
> >         {
> >             text = "<form
> > method=\"POST\"action=\"/jetspeed/servlet/JobSubmit\">\n" +
> >                    "<input type=\"hidden\" name=\"action\"
> > value=\"submitjob\">\n" +
> >                    ..... //additional form elements here
> >                    "</form>
> 
> Your action should just be /jetspeed - as that is the servlet.  The
> action will then passed to all portlets - so using a good unique name
> might avoid clashes.
> 
> >         }
> >         else if(action.equals("submitjob"))
> >         {
> >           //get job parameters here
> >           //submit job based on parameters
> >           success = jobsubmit( ... );
> >           if(success)
> >             {
> >                 text = "Job submitted succesfully!";
> >             } else {
> >               text = "Job failed!";
> >           }
> >         }
> >
> >         return (new StringElement(text));
> >
> >     }
> >
> 
> HTH,
> Chris
> 
> =====
> Need somewhere to Live in London - http://freeflats.com
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org

-- 
_______________________________________________________________________

Aaron Andersen 					Phone: 	(303) 497-1837	
Section Manager					Fax:	(303) 497-1804
Operations and Information Support		e-mail:	aaron@ucar.edu

National Center for Atmospheric Research, PO Box 3000, Boulder CO 80307
_______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic