You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jer Kah <je...@gmail.com> on 2004/11/10 21:02:44 UTC

Converting a struts app to Tapestry

Hello,

   The app I'm currently working on is using Struts and I'm slowly
converting it to Tapestry.  Here's the situation to date:

We have a web app where you log in, and you can access all sorts of
business applications.  Some of these need to know who is logged in,
so currently, in the struts implementation, the user logs in and a
"userView" object (which holds the userid, name, phone number and a
bunch of other stuff unrelated to the user) is put into the session. 
One of these business functions is time accounting (which obviously
needs to know who is logged in).

The first part of this app that I've converted is the time accounting.
 For simplicities sake, I created a temporary login screen using
Tapestry (which is Home.html) that once logged in, takes you to the
new time accounting app.  My plan was to have the login screen (Home)
look at the session, grab the "userView" object, pull out the relavant
user info, put that info into my own UserData object, and redirect (or
forward - what's the difference?) to the new Time Accounting page.

The problem is that I don't know how to set the web app up so that I
can do this.  I've tried setting it up as follows:

Tomcat
...+-webapps
.........+currentApp
..........|....+WEB-INF
..........|
.........+timeaccounting
...............+WEB-INF

Doing it this way, all my links work (i.e. I can have the current app
point to the time accounting and vice versa) but when I get the
session  in my Home.java (the login), the "userView" isn't in it.

So then I decided to put the time accounting app inside the current
app, but after setting it up this way, I realized I don't know how to
set up the web.xml to point to the new time accounting login page.  I
tried a couple different ways, but to no avail. I have a feeling that
this is probably the right way to do it, but I'm new to all this
server-side stuff.  Is this the right approach and if so, what do I
put in my web.xml?

Thanks in advance,
   Jer

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


Re: Converting a struts app to Tapestry

Posted by Jer Kah <je...@gmail.com>.
Nevermind.   I think the error I described is somehow due to the
shotty dev environment I'm in.  I ended up using a hard coded link  (
<a href="/app?service=page/Home"> ).  I know that's not theoretically
the best solution, but it's all I need.

Thanks to all of you who helped.  Now I will shut up and go read
Tapestry in Action.  It's pretty much required reading.

Jer


On Fri, 12 Nov 2004 13:27:32 -0500, Jer Kah <je...@gmail.com> wrote:
> OK, thanks for the tips.  Man, if I'd have bought Tapestry in Action
> before lunch today, I could have spared you all the previous
> trouble...
> 
> However,  I'm still getting something wrong and I don't know what.  I
> have included my tapestry taglib at the top of the jsp page and the
> site still works.  However when I add the line:
> 
> <tapestry:page page="Home">Time Accounting</tapestry:page>
> 
> the pages doesn't load and instead I get the stacktrace:
> 
> javax.servlet.ServletException: javax/servlet/jsp/JspContext
>         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
>         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
>         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
>         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
>         at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
>         at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:582)
>         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
>         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
>         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
>         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
>         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
>         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
>         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
>         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
>         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
>         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
>         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
>         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
>         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
>         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
>         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
>         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
>         at java.lang.Thread.run(Thread.java:534)
> 
> Any ideas on why this is happening?
> 
> -Jer
> 
> 
> 
> 
> On Fri, 12 Nov 2004 07:24:59 -0700, Erik Hatcher
> <er...@ehatchersolutions.com> wrote:
> > Look at the taglibs that ship with Tapestry - they'll provide the
> > proper URL's for you in JSP pages.
> >
> >         Erik
> >
> >
> >
> > On Nov 12, 2004, at 6:48 AM, Jer Kah wrote:
> >
> > > Yes, that clears the session stuff up for me (like I said a few posts
> > > back, I'm still very new to all this server side stuff).
> > >
> > > My question now is how do I create a link in the struts part of the
> > > app to the tapestry part?  Surely I don't just point to Home.html...?
> > >
> > > Here's what the struts part looked like when I came on the project:
> > >
> > > Tomcat
> > > ..+ webapps
> > > .......+ myApp
> > > ............+ some folders (images, etc)
> > > ............+ a bunch of jsp's
> > > ............+ WEB-INF
> > > ..................+ a bunch of tld files
> > > ..................+ web.xml
> > > ..................+ lib directory
> > > ..................+ classes directory.
> > >
> > > So to integrate my tapestry app, I added my class files to the classes
> > > directory, my .page and .html files to the WEB-INF folder and the
> > > proper jar files to the lib directory.  I then added my <servlet>
> > > definition and <servlet-mapping> to the web.xml as described in my
> > > last post.
> > >
> > > No matter what I try, I can't make a link to the tapestry app.  I've
> > > tried putting the following into the address bar to no avail:
> > >
> > > localhost:8080/myApp/TimeAccounting
> > > localhost:8080/myApp/TimeAccounting/
> > > localhost:8080/myApp/TimeAccounting/app
> > > localhost:8080/myApp/TimeAccounting/app/
> > > localhost:8080/TimeAccounting
> > > localhost:8080/TimeAccounting/
> > > localhost:8080/TimeAccounting/app
> > > localhost:8080/TimeAccounting/app/
> > >
> > >
> > > What would be the proper address to my tapestry app?  Is there
> > > anything else I need to add to the web.xml file?
> > >
> > > Thanks for your help.
> > >
> > >    Jer
> > >
> > >
> > >
> > >
> > > On Fri, 12 Nov 2004 05:26:15 -0800 (PST), phillip rhodes
> > > <rh...@yahoo.com> wrote:
> > >>
> > >> A tapestry app and a struts app in the same webapp (same war file)
> > >> will
> > >> share the same HttpSession object.
> > >>
> > >> There is nothing you need to do special.  If you put something into
> > >> the
> > >> session using Tapestry, you would be able to get to from from struts,
> > >> and
> > >> vice versa.
> > >>
> > >> I would stick with simple session stuff for now.  I don't think you
> > >> would
> > >> want to get properties from a tapestry visit object from your struts
> > >> application (and I wouldn't want to try to look up some session form
> > >> bean in
> > >> tapestry).  I would get/set your own domain objects in the
> > >> HttpSession.
> > >>
> > >> Hope that helps.
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> Jer Kah <je...@gmail.com> wrote:
> > >>
> > >>
> > >> OK, it sounds like I should definitly go with one webapp. With that
> > >> being said, how do I integrate the Tapestry part I've made into the
> > >> existing Struts app (so that the tapestry part has access to the same
> > >> session as the struts part via the command
> > >> pageEvent.getRequestCycle().getRequestContext().getSession())?
> > >>
> > >> I'm assuming that I still have to define the tapestry part in the
> > >> web.xml, so I added the following:
> > >>
> > >>
> > >> TimeAccounting
> > >> org.apache.tapestry.ApplicationServlet
> > >> 0
> > >>
> > >> org.apache.tapestry.visit-class
> > >> com.myCompany.common.Visit
> > >>
> > >>
> > >> org.apache.tapestry.global-class
> > >> com.myCompany.common.Global
> > >>
> > >>
> > >>
> > >> to the exisiting web.xml, which already defines several struts apps..
> > >>
> > >>
> > >> action
> > >> org.apache.struts.action.ActionServlet
> > >> ......
> > >>
> > >>
> > >>
> > >> aBusinessFunction
> > >>
> > >> com.myCompany.ClassForABusinessFunction
> > >>
> > >>
> > >>
> > >> ........
> > >>
> > >>
> > >> I also added the servlet mapping:
> > >>
> > >>
> > >> TimeAccounting
> > >> /app
> > >>
> > >>
> > >>
> > >>
> > >> Is there anything else I need to do? Everything I've tried has ended
> > >> in failure.
> > >>
> > >> I guess this all boils down to: How do I make a link from the struts
> > >> part to the tapestry app so that they share the same session? Or is
> > >> it even possible?
> > >>
> > >>
> > >> Thanks for putting up with me and my questions.
> > >> Jer
> > >>
> > >>
> > >>
> > >>
> > >> On Wed, 10 Nov 2004 19:02:16 -0800 (PST), phillip rhodes
> > >> wrote:
> > >>> I would advise you against two web apps. Unless you
> > >>> are trying to go for that distributed fault tolerant
> > >>> thing, it is not going to buy you much to have it in
> > >>> different webapps.
> > >>>
> > >>> That said, if you are using tomcat, they have a module
> > >>> that allows session information to span webapps.
> > >>> That would probably be the easiest to implement.
> > >>>
> > >>> If you really really want a SSO solution between
> > >>> struts and tapestry, I am working on that myself.
> > >>> Contact me off-line if you are interested in
> > >>> discussing further.
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> --- Jer Kah wrote:
> > >>>
> > >>>> Hello,
> > >>>>
> > >>>> The app I'm currently working on is using Struts
> > >>>> and I'm slowly
> > >>>> converting it to Tapestry. Here's the situation to
> > >>>> date:
> > >>>>
> > >>>> We have a web app where you log in, and you can
> > >>>> access all sorts of
> > >>>> business applications. Some of these need to know
> > >>>> who is logged in,
> > >>>> so currently, in the struts implementation, the user
> > >>>> logs in and a
> > >>>> "userView" object (which holds the userid, name,
> > >>>> phone number and a
> > >>>> bunch of other stuff unrelated to the user) is put
> > >>>> into the session.
> > >>>> One of these business functions is time accounting
> > >>>> (which obviously
> > >>>> needs to know who is logged in).
> > >>>>
> > >>>> The first part of this app that I've converted is
> > >>>> the time accounting.
> > >>>> For simplicities sake, I created a temporary login
> > >>>> screen using
> > >>>> Tapestry (which is Home.html) that once logged in,
> > >>>> takes you to the
> > >>>> new time accounting app. My plan was to have the
> > >>>> login screen (Home)
> > >>>> look at the session, grab the "userView" object,
> > >>>> pull out the relavant
> > >>>> user info, put that info into my own UserData
> > >>>> object, and redirect (or
> > >>>> forward - what's the difference?) to the new Time
> > >>>> Accounting page.
> > >>>>
> > >>>> The problem is that I don't know how to set the web
> > >>>> app up so that I
> > >>>> can do this. I've tried setting it up as follows:
> > >>>>
> > >>>> Tomcat
> > >>>> ...+-webapps
> > >>>> .........+currentApp
> > >>>> ..........|....+WEB-INF
> > >>>> ..........|
> > >>>> .........+timeaccounting
> > >>>> ...............+WEB-INF
> > >>>>
> > >>>> Doing it this way, all my links work (i.e. I can
> > >>>> have the current app
> > >>>> point to the time accounting and vice versa) but
> > >>>> when I get the
> > >>>> session in my Home.java (the login), the "userView"
> > >>>> isn't in it.
> > >>>>
> > >>>> So then I decided to put the time accounting app
> > >>>> inside the current
> > >>>> app, but after setting it up this way, I realized I
> > >>>> don't know how to
> > >>>> set up the web.xml to point to the new time
> > >>>> accounting login page. I
> > >>>> tried a couple different ways, but to no avail. I
> > >>>> have a feeling that
> > >>>> this is probably the right way to do it, but I'm new
> > >>>> to all this
> > >>>> server-side stuff. Is this the right approach and
> > >>>> if so, what do I
> > >>>> put in my web.xml?
> > >>>>
> > >>>> Thanks in advance,
> > >>>> Jer
> > >>>>
> > >>>>
> > >>> ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail:
> > >>>> tapestry-user-unsubscribe@jakarta.apache.org
> > >>>> For additional commands, e-mail:
> > >>>> tapestry-user-help@jakarta.apache.org
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > >> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> >
> >
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>

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


Re: Converting a struts app to Tapestry

Posted by Jer Kah <je...@gmail.com>.
OK, thanks for the tips.  Man, if I'd have bought Tapestry in Action
before lunch today, I could have spared you all the previous
trouble...

However,  I'm still getting something wrong and I don't know what.  I
have included my tapestry taglib at the top of the jsp page and the
site still works.  However when I add the line:

<tapestry:page page="Home">Time Accounting</tapestry:page>


the pages doesn't load and instead I get the stacktrace:

javax.servlet.ServletException: javax/servlet/jsp/JspContext
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
	at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
	at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
	at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:582)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
	at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
	at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)



Any ideas on why this is happening?

-Jer



On Fri, 12 Nov 2004 07:24:59 -0700, Erik Hatcher
<er...@ehatchersolutions.com> wrote:
> Look at the taglibs that ship with Tapestry - they'll provide the
> proper URL's for you in JSP pages.
> 
>         Erik
> 
> 
> 
> On Nov 12, 2004, at 6:48 AM, Jer Kah wrote:
> 
> > Yes, that clears the session stuff up for me (like I said a few posts
> > back, I'm still very new to all this server side stuff).
> >
> > My question now is how do I create a link in the struts part of the
> > app to the tapestry part?  Surely I don't just point to Home.html...?
> >
> > Here's what the struts part looked like when I came on the project:
> >
> > Tomcat
> > ..+ webapps
> > .......+ myApp
> > ............+ some folders (images, etc)
> > ............+ a bunch of jsp's
> > ............+ WEB-INF
> > ..................+ a bunch of tld files
> > ..................+ web.xml
> > ..................+ lib directory
> > ..................+ classes directory.
> >
> > So to integrate my tapestry app, I added my class files to the classes
> > directory, my .page and .html files to the WEB-INF folder and the
> > proper jar files to the lib directory.  I then added my <servlet>
> > definition and <servlet-mapping> to the web.xml as described in my
> > last post.
> >
> > No matter what I try, I can't make a link to the tapestry app.  I've
> > tried putting the following into the address bar to no avail:
> >
> > localhost:8080/myApp/TimeAccounting
> > localhost:8080/myApp/TimeAccounting/
> > localhost:8080/myApp/TimeAccounting/app
> > localhost:8080/myApp/TimeAccounting/app/
> > localhost:8080/TimeAccounting
> > localhost:8080/TimeAccounting/
> > localhost:8080/TimeAccounting/app
> > localhost:8080/TimeAccounting/app/
> >
> >
> > What would be the proper address to my tapestry app?  Is there
> > anything else I need to add to the web.xml file?
> >
> > Thanks for your help.
> >
> >    Jer
> >
> >
> >
> >
> > On Fri, 12 Nov 2004 05:26:15 -0800 (PST), phillip rhodes
> > <rh...@yahoo.com> wrote:
> >>
> >> A tapestry app and a struts app in the same webapp (same war file)
> >> will
> >> share the same HttpSession object.
> >>
> >> There is nothing you need to do special.  If you put something into
> >> the
> >> session using Tapestry, you would be able to get to from from struts,
> >> and
> >> vice versa.
> >>
> >> I would stick with simple session stuff for now.  I don't think you
> >> would
> >> want to get properties from a tapestry visit object from your struts
> >> application (and I wouldn't want to try to look up some session form
> >> bean in
> >> tapestry).  I would get/set your own domain objects in the
> >> HttpSession.
> >>
> >> Hope that helps.
> >>
> >>
> >>
> >>
> >>
> >> Jer Kah <je...@gmail.com> wrote:
> >>
> >>
> >> OK, it sounds like I should definitly go with one webapp. With that
> >> being said, how do I integrate the Tapestry part I've made into the
> >> existing Struts app (so that the tapestry part has access to the same
> >> session as the struts part via the command
> >> pageEvent.getRequestCycle().getRequestContext().getSession())?
> >>
> >> I'm assuming that I still have to define the tapestry part in the
> >> web.xml, so I added the following:
> >>
> >>
> >> TimeAccounting
> >> org.apache.tapestry.ApplicationServlet
> >> 0
> >>
> >> org.apache.tapestry.visit-class
> >> com.myCompany.common.Visit
> >>
> >>
> >> org.apache.tapestry.global-class
> >> com.myCompany.common.Global
> >>
> >>
> >>
> >> to the exisiting web.xml, which already defines several struts apps..
> >>
> >>
> >> action
> >> org.apache.struts.action.ActionServlet
> >> ......
> >>
> >>
> >>
> >> aBusinessFunction
> >>
> >> com.myCompany.ClassForABusinessFunction
> >>
> >>
> >>
> >> ........
> >>
> >>
> >> I also added the servlet mapping:
> >>
> >>
> >> TimeAccounting
> >> /app
> >>
> >>
> >>
> >>
> >> Is there anything else I need to do? Everything I've tried has ended
> >> in failure.
> >>
> >> I guess this all boils down to: How do I make a link from the struts
> >> part to the tapestry app so that they share the same session? Or is
> >> it even possible?
> >>
> >>
> >> Thanks for putting up with me and my questions.
> >> Jer
> >>
> >>
> >>
> >>
> >> On Wed, 10 Nov 2004 19:02:16 -0800 (PST), phillip rhodes
> >> wrote:
> >>> I would advise you against two web apps. Unless you
> >>> are trying to go for that distributed fault tolerant
> >>> thing, it is not going to buy you much to have it in
> >>> different webapps.
> >>>
> >>> That said, if you are using tomcat, they have a module
> >>> that allows session information to span webapps.
> >>> That would probably be the easiest to implement.
> >>>
> >>> If you really really want a SSO solution between
> >>> struts and tapestry, I am working on that myself.
> >>> Contact me off-line if you are interested in
> >>> discussing further.
> >>>
> >>>
> >>>
> >>>
> >>> --- Jer Kah wrote:
> >>>
> >>>> Hello,
> >>>>
> >>>> The app I'm currently working on is using Struts
> >>>> and I'm slowly
> >>>> converting it to Tapestry. Here's the situation to
> >>>> date:
> >>>>
> >>>> We have a web app where you log in, and you can
> >>>> access all sorts of
> >>>> business applications. Some of these need to know
> >>>> who is logged in,
> >>>> so currently, in the struts implementation, the user
> >>>> logs in and a
> >>>> "userView" object (which holds the userid, name,
> >>>> phone number and a
> >>>> bunch of other stuff unrelated to the user) is put
> >>>> into the session.
> >>>> One of these business functions is time accounting
> >>>> (which obviously
> >>>> needs to know who is logged in).
> >>>>
> >>>> The first part of this app that I've converted is
> >>>> the time accounting.
> >>>> For simplicities sake, I created a temporary login
> >>>> screen using
> >>>> Tapestry (which is Home.html) that once logged in,
> >>>> takes you to the
> >>>> new time accounting app. My plan was to have the
> >>>> login screen (Home)
> >>>> look at the session, grab the "userView" object,
> >>>> pull out the relavant
> >>>> user info, put that info into my own UserData
> >>>> object, and redirect (or
> >>>> forward - what's the difference?) to the new Time
> >>>> Accounting page.
> >>>>
> >>>> The problem is that I don't know how to set the web
> >>>> app up so that I
> >>>> can do this. I've tried setting it up as follows:
> >>>>
> >>>> Tomcat
> >>>> ...+-webapps
> >>>> .........+currentApp
> >>>> ..........|....+WEB-INF
> >>>> ..........|
> >>>> .........+timeaccounting
> >>>> ...............+WEB-INF
> >>>>
> >>>> Doing it this way, all my links work (i.e. I can
> >>>> have the current app
> >>>> point to the time accounting and vice versa) but
> >>>> when I get the
> >>>> session in my Home.java (the login), the "userView"
> >>>> isn't in it.
> >>>>
> >>>> So then I decided to put the time accounting app
> >>>> inside the current
> >>>> app, but after setting it up this way, I realized I
> >>>> don't know how to
> >>>> set up the web.xml to point to the new time
> >>>> accounting login page. I
> >>>> tried a couple different ways, but to no avail. I
> >>>> have a feeling that
> >>>> this is probably the right way to do it, but I'm new
> >>>> to all this
> >>>> server-side stuff. Is this the right approach and
> >>>> if so, what do I
> >>>> put in my web.xml?
> >>>>
> >>>> Thanks in advance,
> >>>> Jer
> >>>>
> >>>>
> >>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail:
> >>>> tapestry-user-unsubscribe@jakarta.apache.org
> >>>> For additional commands, e-mail:
> >>>> tapestry-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> 
> 
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

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


Re: Converting a struts app to Tapestry

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Look at the taglibs that ship with Tapestry - they'll provide the 
proper URL's for you in JSP pages.

	Erik

On Nov 12, 2004, at 6:48 AM, Jer Kah wrote:

> Yes, that clears the session stuff up for me (like I said a few posts
> back, I'm still very new to all this server side stuff).
>
> My question now is how do I create a link in the struts part of the
> app to the tapestry part?  Surely I don't just point to Home.html...?
>
> Here's what the struts part looked like when I came on the project:
>
> Tomcat
> ..+ webapps
> .......+ myApp
> ............+ some folders (images, etc)
> ............+ a bunch of jsp's
> ............+ WEB-INF
> ..................+ a bunch of tld files
> ..................+ web.xml
> ..................+ lib directory
> ..................+ classes directory.
>
> So to integrate my tapestry app, I added my class files to the classes
> directory, my .page and .html files to the WEB-INF folder and the
> proper jar files to the lib directory.  I then added my <servlet>
> definition and <servlet-mapping> to the web.xml as described in my
> last post.
>
> No matter what I try, I can't make a link to the tapestry app.  I've
> tried putting the following into the address bar to no avail:
>
> localhost:8080/myApp/TimeAccounting
> localhost:8080/myApp/TimeAccounting/
> localhost:8080/myApp/TimeAccounting/app
> localhost:8080/myApp/TimeAccounting/app/
> localhost:8080/TimeAccounting
> localhost:8080/TimeAccounting/
> localhost:8080/TimeAccounting/app
> localhost:8080/TimeAccounting/app/
>
>
> What would be the proper address to my tapestry app?  Is there
> anything else I need to add to the web.xml file?
>
> Thanks for your help.
>
>    Jer
>
>
>
>
> On Fri, 12 Nov 2004 05:26:15 -0800 (PST), phillip rhodes
> <rh...@yahoo.com> wrote:
>>
>> A tapestry app and a struts app in the same webapp (same war file) 
>> will
>> share the same HttpSession object.
>>
>> There is nothing you need to do special.  If you put something into 
>> the
>> session using Tapestry, you would be able to get to from from struts, 
>> and
>> vice versa.
>>
>> I would stick with simple session stuff for now.  I don't think you 
>> would
>> want to get properties from a tapestry visit object from your struts
>> application (and I wouldn't want to try to look up some session form 
>> bean in
>> tapestry).  I would get/set your own domain objects in the 
>> HttpSession.
>>
>> Hope that helps.
>>
>>
>>
>>
>>
>> Jer Kah <je...@gmail.com> wrote:
>>
>>
>> OK, it sounds like I should definitly go with one webapp. With that
>> being said, how do I integrate the Tapestry part I've made into the
>> existing Struts app (so that the tapestry part has access to the same
>> session as the struts part via the command
>> pageEvent.getRequestCycle().getRequestContext().getSession())?
>>
>> I'm assuming that I still have to define the tapestry part in the
>> web.xml, so I added the following:
>>
>>
>> TimeAccounting
>> org.apache.tapestry.ApplicationServlet
>> 0
>>
>> org.apache.tapestry.visit-class
>> com.myCompany.common.Visit
>>
>>
>> org.apache.tapestry.global-class
>> com.myCompany.common.Global
>>
>>
>>
>> to the exisiting web.xml, which already defines several struts apps..
>>
>>
>> action
>> org.apache.struts.action.ActionServlet
>> ......
>>
>>
>>
>> aBusinessFunction
>>
>> com.myCompany.ClassForABusinessFunction
>>
>>
>>
>> ........
>>
>>
>> I also added the servlet mapping:
>>
>>
>> TimeAccounting
>> /app
>>
>>
>>
>>
>> Is there anything else I need to do? Everything I've tried has ended
>> in failure.
>>
>> I guess this all boils down to: How do I make a link from the struts
>> part to the tapestry app so that they share the same session? Or is
>> it even possible?
>>
>>
>> Thanks for putting up with me and my questions.
>> Jer
>>
>>
>>
>>
>> On Wed, 10 Nov 2004 19:02:16 -0800 (PST), phillip rhodes
>> wrote:
>>> I would advise you against two web apps. Unless you
>>> are trying to go for that distributed fault tolerant
>>> thing, it is not going to buy you much to have it in
>>> different webapps.
>>>
>>> That said, if you are using tomcat, they have a module
>>> that allows session information to span webapps.
>>> That would probably be the easiest to implement.
>>>
>>> If you really really want a SSO solution between
>>> struts and tapestry, I am working on that myself.
>>> Contact me off-line if you are interested in
>>> discussing further.
>>>
>>>
>>>
>>>
>>> --- Jer Kah wrote:
>>>
>>>> Hello,
>>>>
>>>> The app I'm currently working on is using Struts
>>>> and I'm slowly
>>>> converting it to Tapestry. Here's the situation to
>>>> date:
>>>>
>>>> We have a web app where you log in, and you can
>>>> access all sorts of
>>>> business applications. Some of these need to know
>>>> who is logged in,
>>>> so currently, in the struts implementation, the user
>>>> logs in and a
>>>> "userView" object (which holds the userid, name,
>>>> phone number and a
>>>> bunch of other stuff unrelated to the user) is put
>>>> into the session.
>>>> One of these business functions is time accounting
>>>> (which obviously
>>>> needs to know who is logged in).
>>>>
>>>> The first part of this app that I've converted is
>>>> the time accounting.
>>>> For simplicities sake, I created a temporary login
>>>> screen using
>>>> Tapestry (which is Home.html) that once logged in,
>>>> takes you to the
>>>> new time accounting app. My plan was to have the
>>>> login screen (Home)
>>>> look at the session, grab the "userView" object,
>>>> pull out the relavant
>>>> user info, put that info into my own UserData
>>>> object, and redirect (or
>>>> forward - what's the difference?) to the new Time
>>>> Accounting page.
>>>>
>>>> The problem is that I don't know how to set the web
>>>> app up so that I
>>>> can do this. I've tried setting it up as follows:
>>>>
>>>> Tomcat
>>>> ...+-webapps
>>>> .........+currentApp
>>>> ..........|....+WEB-INF
>>>> ..........|
>>>> .........+timeaccounting
>>>> ...............+WEB-INF
>>>>
>>>> Doing it this way, all my links work (i.e. I can
>>>> have the current app
>>>> point to the time accounting and vice versa) but
>>>> when I get the
>>>> session in my Home.java (the login), the "userView"
>>>> isn't in it.
>>>>
>>>> So then I decided to put the time accounting app
>>>> inside the current
>>>> app, but after setting it up this way, I realized I
>>>> don't know how to
>>>> set up the web.xml to point to the new time
>>>> accounting login page. I
>>>> tried a couple different ways, but to no avail. I
>>>> have a feeling that
>>>> this is probably the right way to do it, but I'm new
>>>> to all this
>>>> server-side stuff. Is this the right approach and
>>>> if so, what do I
>>>> put in my web.xml?
>>>>
>>>> Thanks in advance,
>>>> Jer
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>>>> tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: Converting a struts app to Tapestry

Posted by Jer Kah <je...@gmail.com>.
Yes, that clears the session stuff up for me (like I said a few posts
back, I'm still very new to all this server side stuff).

My question now is how do I create a link in the struts part of the
app to the tapestry part?  Surely I don't just point to Home.html...?

Here's what the struts part looked like when I came on the project:

Tomcat
..+ webapps
.......+ myApp
............+ some folders (images, etc)
............+ a bunch of jsp's
............+ WEB-INF
..................+ a bunch of tld files
..................+ web.xml
..................+ lib directory
..................+ classes directory.

So to integrate my tapestry app, I added my class files to the classes
directory, my .page and .html files to the WEB-INF folder and the
proper jar files to the lib directory.  I then added my <servlet>
definition and <servlet-mapping> to the web.xml as described in my
last post.

No matter what I try, I can't make a link to the tapestry app.  I've
tried putting the following into the address bar to no avail:

localhost:8080/myApp/TimeAccounting
localhost:8080/myApp/TimeAccounting/
localhost:8080/myApp/TimeAccounting/app
localhost:8080/myApp/TimeAccounting/app/
localhost:8080/TimeAccounting
localhost:8080/TimeAccounting/
localhost:8080/TimeAccounting/app
localhost:8080/TimeAccounting/app/


What would be the proper address to my tapestry app?  Is there
anything else I need to add to the web.xml file?

Thanks for your help.

   Jer




On Fri, 12 Nov 2004 05:26:15 -0800 (PST), phillip rhodes
<rh...@yahoo.com> wrote:
> 
> A tapestry app and a struts app in the same webapp (same war file) will
> share the same HttpSession object. 
>   
> There is nothing you need to do special.  If you put something into the
> session using Tapestry, you would be able to get to from from struts, and
> vice versa. 
>   
> I would stick with simple session stuff for now.  I don't think you would
> want to get properties from a tapestry visit object from your struts
> application (and I wouldn't want to try to look up some session form bean in
> tapestry).  I would get/set your own domain objects in the HttpSession. 
>   
> Hope that helps.
> 
>  
>   
> 
> 
> Jer Kah <je...@gmail.com> wrote: 
> 
> 
> OK, it sounds like I should definitly go with one webapp. With that
> being said, how do I integrate the Tapestry part I've made into the
> existing Struts app (so that the tapestry part has access to the same
> session as the struts part via the command
> pageEvent.getRequestCycle().getRequestContext().getSession())?
> 
> I'm assuming that I still have to define the tapestry part in the
> web.xml, so I added the following:
> 
> 
> TimeAccounting
> org.apache.tapestry.ApplicationServlet
> 0
> 
> org.apache.tapestry.visit-class
> com.myCompany.common.Visit
> 
> 
> org.apache.tapestry.global-class
> com.myCompany.common.Global
> 
> 
> 
> to the exisiting web.xml, which already defines several struts apps..
> 
> 
> action 
> org.apache.struts.action.ActionServlet
> ......
> 
> 
> 
> aBusinessFunction 
> 
> com.myCompany.ClassForABusinessFunction
> 
> 
> 
> ........
> 
> 
> I also added the servlet mapping:
> 
> 
> TimeAccounting
> /app
> 
> 
> 
> 
> Is there anything else I need to do? Everything I've tried has ended
> in failure.
> 
> I guess this all boils down to: How do I make a link from the struts
> part to the tapestry app so that they share the same session? Or is
> it even possible?
> 
> 
> Thanks for putting up with me and my questions.
> Jer
> 
> 
> 
> 
> On Wed, 10 Nov 2004 19:02:16 -0800 (PST), phillip rhodes
> wrote:
> > I would advise you against two web apps. Unless you
> > are trying to go for that distributed fault tolerant
> > thing, it is not going to buy you much to have it in
> > different webapps.
> > 
> > That said, if you are using tomcat, they have a module
> > that allows session information to span webapps.
> > That would probably be the easiest to implement.
> > 
> > If you really really want a SSO solution between
> > struts and tapestry, I am working on that myself.
> > Contact me off-line if you are interested in
> > discussing further.
> > 
> > 
> > 
> > 
> > --- Jer Kah wrote:
> > 
> > > Hello,
> > >
> > > The app I'm currently working on is using Struts
> > > and I'm slowly
> > > converting it to Tapestry. Here's the situation to
> > > date:
> > >
> > > We have a web app where you log in, and you can
> > > access all sorts of
> > > business applications. Some of these need to know
> > > who is logged in,
> > > so currently, in the struts implementation, the user
> > > logs in and a
> > > "userView" object (which holds the userid, name,
> > > phone number and a
> > > bunch of other stuff unrelated to the user) is put
> > > into the session.
> > > One of these business functions is time accounting
> > > (which obviously
> > > needs to know who is logged in).
> > >
> > > The first part of this app that I've converted is
> > > the time accounting.
> > > For simplicities sake, I created a temporary login
> > > screen using
> > > Tapestry (which is Home.html) that once logged in,
> > > takes you to the
> > > new time accounting app. My plan was to have the
> > > login screen (Home)
> > > look at the session, grab the "userView" object,
> > > pull out the relavant
> > > user info, put that info into my own UserData
> > > object, and redirect (or
> > > forward - what's the difference?) to the new Time
> > > Accounting page.
> > >
> > > The problem is that I don't know how to set the web
> > > app up so that I
> > > can do this. I've tried setting it up as follows:
> > >
> > > Tomcat
> > > ...+-webapps
> > > .........+currentApp
> > > ..........|....+WEB-INF
> > > ..........|
> > > .........+timeaccounting
> > > ...............+WEB-INF
> > >
> > > Doing it this way, all my links work (i.e. I can
> > > have the current app
> > > point to the time accounting and vice versa) but
> > > when I get the
> > > session in my Home.java (the login), the "userView"
> > > isn't in it.
> > >
> > > So then I decided to put the time accounting app
> > > inside the current
> > > app, but after setting it up this way, I realized I
> > > don't know how to
> > > set up the web.xml to point to the new time
> > > accounting login page. I
> > > tried a couple different ways, but to no avail. I
> > > have a feeling that
> > > this is probably the right way to do it, but I'm new
> > > to all this
> > > server-side stuff. Is this the right approach and
> > > if so, what do I
> > > put in my web.xml?
> > >
> > > Thanks in advance,
> > > Jer
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > tapestry-user-help@jakarta.apache.org
> > >
> > >
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

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


Re: Converting a struts app to Tapestry

Posted by phillip rhodes <rh...@yahoo.com>.
A tapestry app and a struts app in the same webapp (same war file) will share the same HttpSession object.
 
There is nothing you need to do special.  If you put something into the session using Tapestry, you would be able to get to from from struts, and vice versa.
 
I would stick with simple session stuff for now.  I don't think you would want to get properties from a tapestry visit object from your struts application (and I wouldn't want to try to look up some session form bean in tapestry).  I would get/set your own domain objects in the HttpSession.
 
Hope that helps.
 


Jer Kah <je...@gmail.com> wrote:
OK, it sounds like I should definitly go with one webapp. With that
being said, how do I integrate the Tapestry part I've made into the
existing Struts app (so that the tapestry part has access to the same
session as the struts part via the command
pageEvent.getRequestCycle().getRequestContext().getSession())?

I'm assuming that I still have to define the tapestry part in the
web.xml, so I added the following:


TimeAccounting
org.apache.tapestry.ApplicationServlet
0


org.apache.tapestry.visit-class


com.myCompany.common.Visit




org.apache.tapestry.global-class


com.myCompany.common.Global




to the exisiting web.xml, which already defines several struts apps..


action 
org.apache.struts.action.ActionServlet
......



aBusinessFunction 

com.myCompany.ClassForABusinessFunction



........


I also added the servlet mapping:


TimeAccounting
/app


Is there anything else I need to do? Everything I've tried has ended
in failure.

I guess this all boils down to: How do I make a link from the struts
part to the tapestry app so that they share the same session? Or is
it even possible?


Thanks for putting up with me and my questions.
Jer




On Wed, 10 Nov 2004 19:02:16 -0800 (PST), phillip rhodes
wrote:
> I would advise you against two web apps. Unless you
> are trying to go for that distributed fault tolerant
> thing, it is not going to buy you much to have it in
> different webapps.
> 
> That said, if you are using tomcat, they have a module
> that allows session information to span webapps.
> That would probably be the easiest to implement.
> 
> If you really really want a SSO solution between
> struts and tapestry, I am working on that myself.
> Contact me off-line if you are interested in
> discussing further.
> 
> 
> 
> 
> --- Jer Kah wrote:
> 
> > Hello,
> >
> > The app I'm currently working on is using Struts
> > and I'm slowly
> > converting it to Tapestry. Here's the situation to
> > date:
> >
> > We have a web app where you log in, and you can
> > access all sorts of
> > business applications. Some of these need to know
> > who is logged in,
> > so currently, in the struts implementation, the user
> > logs in and a
> > "userView" object (which holds the userid, name,
> > phone number and a
> > bunch of other stuff unrelated to the user) is put
> > into the session.
> > One of these business functions is time accounting
> > (which obviously
> > needs to know who is logged in).
> >
> > The first part of this app that I've converted is
> > the time accounting.
> > For simplicities sake, I created a temporary login
> > screen using
> > Tapestry (which is Home.html) that once logged in,
> > takes you to the
> > new time accounting app. My plan was to have the
> > login screen (Home)
> > look at the session, grab the "userView" object,
> > pull out the relavant
> > user info, put that info into my own UserData
> > object, and redirect (or
> > forward - what's the difference?) to the new Time
> > Accounting page.
> >
> > The problem is that I don't know how to set the web
> > app up so that I
> > can do this. I've tried setting it up as follows:
> >
> > Tomcat
> > ...+-webapps
> > .........+currentApp
> > ..........|....+WEB-INF
> > ..........|
> > .........+timeaccounting
> > ...............+WEB-INF
> >
> > Doing it this way, all my links work (i.e. I can
> > have the current app
> > point to the time accounting and vice versa) but
> > when I get the
> > session in my Home.java (the login), the "userView"
> > isn't in it.
> >
> > So then I decided to put the time accounting app
> > inside the current
> > app, but after setting it up this way, I realized I
> > don't know how to
> > set up the web.xml to point to the new time
> > accounting login page. I
> > tried a couple different ways, but to no avail. I
> > have a feeling that
> > this is probably the right way to do it, but I'm new
> > to all this
> > server-side stuff. Is this the right approach and
> > if so, what do I
> > put in my web.xml?
> >
> > Thanks in advance,
> > Jer
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> >
> >
> 
>

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


Re: Converting a struts app to Tapestry

Posted by Jer Kah <je...@gmail.com>.
OK, it sounds like I should definitly go with one webapp.  With that
being said, how do I integrate the Tapestry part I've made into the
existing Struts app (so that the tapestry part has access to the same
session as the struts part via the command
pageEvent.getRequestCycle().getRequestContext().getSession())?

I'm assuming that I still have to define the tapestry part in the
web.xml, so I added the following:

   <servlet>
        <servlet-name>TimeAccounting</servlet-name>
        <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
        <init-param>
            <param-name>org.apache.tapestry.visit-class</param-name>
            <param-value>com.myCompany.common.Visit</param-value>
        </init-param>
        <init-param>
            <param-name>org.apache.tapestry.global-class</param-name>
            <param-value>com.myCompany.common.Global</param-value>
        </init-param>
    </servlet>

to the exisiting web.xml, which already defines several struts apps..

<servlet>
    <servlet-name>action</servlet-name>                                     
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
 ......
</servlet>

<servlet>
  <servlet-name>aBusinessFunction</servlet-name>    <!--  OK  -->
  <servlet-class>
    com.myCompany.ClassForABusinessFunction
  </servlet-class>
</servlet>

........


I also added the servlet mapping:

    <servlet-mapping>
        <servlet-name>TimeAccounting</servlet-name>
        <url-pattern>/app</url-pattern>
    </servlet-mapping>

Is there anything else I need to do?  Everything I've tried has ended
in failure.

I guess this all boils down to: How do I make a link from the struts
part to the tapestry app so that they share the same session?   Or is
it even possible?


Thanks for putting up with me and my questions.
   Jer




On Wed, 10 Nov 2004 19:02:16 -0800 (PST), phillip rhodes
<rh...@yahoo.com> wrote:
> I would advise you against two web apps.  Unless you
> are trying to go for that distributed fault tolerant
> thing, it is not going to buy you much to have it in
> different webapps.
> 
> That said, if you are using tomcat, they have a module
> that allows session information to span webapps.
> That would probably be the easiest to implement.
> 
> If you really really want a SSO solution between
> struts and tapestry, I am working on that myself.
> Contact me off-line if you are interested in
> discussing further.
> 
> 
> 
> 
> --- Jer Kah <je...@gmail.com> wrote:
> 
> > Hello,
> >
> >    The app I'm currently working on is using Struts
> > and I'm slowly
> > converting it to Tapestry.  Here's the situation to
> > date:
> >
> > We have a web app where you log in, and you can
> > access all sorts of
> > business applications.  Some of these need to know
> > who is logged in,
> > so currently, in the struts implementation, the user
> > logs in and a
> > "userView" object (which holds the userid, name,
> > phone number and a
> > bunch of other stuff unrelated to the user) is put
> > into the session.
> > One of these business functions is time accounting
> > (which obviously
> > needs to know who is logged in).
> >
> > The first part of this app that I've converted is
> > the time accounting.
> >  For simplicities sake, I created a temporary login
> > screen using
> > Tapestry (which is Home.html) that once logged in,
> > takes you to the
> > new time accounting app.  My plan was to have the
> > login screen (Home)
> > look at the session, grab the "userView" object,
> > pull out the relavant
> > user info, put that info into my own UserData
> > object, and redirect (or
> > forward - what's the difference?) to the new Time
> > Accounting page.
> >
> > The problem is that I don't know how to set the web
> > app up so that I
> > can do this.  I've tried setting it up as follows:
> >
> > Tomcat
> > ...+-webapps
> > .........+currentApp
> > ..........|....+WEB-INF
> > ..........|
> > .........+timeaccounting
> > ...............+WEB-INF
> >
> > Doing it this way, all my links work (i.e. I can
> > have the current app
> > point to the time accounting and vice versa) but
> > when I get the
> > session  in my Home.java (the login), the "userView"
> > isn't in it.
> >
> > So then I decided to put the time accounting app
> > inside the current
> > app, but after setting it up this way, I realized I
> > don't know how to
> > set up the web.xml to point to the new time
> > accounting login page.  I
> > tried a couple different ways, but to no avail. I
> > have a feeling that
> > this is probably the right way to do it, but I'm new
> > to all this
> > server-side stuff.  Is this the right approach and
> > if so, what do I
> > put in my web.xml?
> >
> > Thanks in advance,
> >    Jer
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> >
> >
> 
>

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


Re: Converting a struts app to Tapestry

Posted by phillip rhodes <rh...@yahoo.com>.
I would advise you against two web apps.  Unless you
are trying to go for that distributed fault tolerant
thing, it is not going to buy you much to have it in
different webapps. 

That said, if you are using tomcat, they have a module
that allows session information to span webapps.
That would probably be the easiest to implement.


If you really really want a SSO solution between
struts and tapestry, I am working on that myself.
Contact me off-line if you are interested in
discussing further.






--- Jer Kah <je...@gmail.com> wrote:

> Hello,
> 
>    The app I'm currently working on is using Struts
> and I'm slowly
> converting it to Tapestry.  Here's the situation to
> date:
> 
> We have a web app where you log in, and you can
> access all sorts of
> business applications.  Some of these need to know
> who is logged in,
> so currently, in the struts implementation, the user
> logs in and a
> "userView" object (which holds the userid, name,
> phone number and a
> bunch of other stuff unrelated to the user) is put
> into the session. 
> One of these business functions is time accounting
> (which obviously
> needs to know who is logged in).
> 
> The first part of this app that I've converted is
> the time accounting.
>  For simplicities sake, I created a temporary login
> screen using
> Tapestry (which is Home.html) that once logged in,
> takes you to the
> new time accounting app.  My plan was to have the
> login screen (Home)
> look at the session, grab the "userView" object,
> pull out the relavant
> user info, put that info into my own UserData
> object, and redirect (or
> forward - what's the difference?) to the new Time
> Accounting page.
> 
> The problem is that I don't know how to set the web
> app up so that I
> can do this.  I've tried setting it up as follows:
> 
> Tomcat
> ...+-webapps
> .........+currentApp
> ..........|....+WEB-INF
> ..........|
> .........+timeaccounting
> ...............+WEB-INF
> 
> Doing it this way, all my links work (i.e. I can
> have the current app
> point to the time accounting and vice versa) but
> when I get the
> session  in my Home.java (the login), the "userView"
> isn't in it.
> 
> So then I decided to put the time accounting app
> inside the current
> app, but after setting it up this way, I realized I
> don't know how to
> set up the web.xml to point to the new time
> accounting login page.  I
> tried a couple different ways, but to no avail. I
> have a feeling that
> this is probably the right way to do it, but I'm new
> to all this
> server-side stuff.  Is this the right approach and
> if so, what do I
> put in my web.xml?
> 
> Thanks in advance,
>    Jer
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


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


Re: Converting a struts app to Tapestry

Posted by Jonny Wray <jo...@yahoo.com>.
You are correct in that you can't share session data across seperate
web applications. If you need different applications to share the same
session data they need to be in the same web application - the
application seperation is just a logical seperation of your code base.

However, it looks here like you might be after some sort of single sign
on, where the single signin can act as authentication for multiple web
applications. This will allow you to seperate your applications into
different web applications (as long as they don't share other session
info) but still only have to sign on once.

I use the acegi security package that is part of the spring project,
and it comes with integration to a SSO package (which I haven't used
myself).

--- Jer Kah <je...@gmail.com> wrote:

> Hello,
> 
>    The app I'm currently working on is using Struts and I'm slowly
> converting it to Tapestry.  Here's the situation to date:
> 
> We have a web app where you log in, and you can access all sorts of
> business applications.  Some of these need to know who is logged in,
> so currently, in the struts implementation, the user logs in and a
> "userView" object (which holds the userid, name, phone number and a
> bunch of other stuff unrelated to the user) is put into the session. 
> One of these business functions is time accounting (which obviously
> needs to know who is logged in).
> 
> The first part of this app that I've converted is the time
> accounting.
>  For simplicities sake, I created a temporary login screen using
> Tapestry (which is Home.html) that once logged in, takes you to the
> new time accounting app.  My plan was to have the login screen (Home)
> look at the session, grab the "userView" object, pull out the
> relavant
> user info, put that info into my own UserData object, and redirect
> (or
> forward - what's the difference?) to the new Time Accounting page.
> 
> The problem is that I don't know how to set the web app up so that I
> can do this.  I've tried setting it up as follows:
> 
> Tomcat
> ...+-webapps
> .........+currentApp
> ..........|....+WEB-INF
> ..........|
> .........+timeaccounting
> ...............+WEB-INF
> 
> Doing it this way, all my links work (i.e. I can have the current app
> point to the time accounting and vice versa) but when I get the
> session  in my Home.java (the login), the "userView" isn't in it.
> 
> So then I decided to put the time accounting app inside the current
> app, but after setting it up this way, I realized I don't know how to
> set up the web.xml to point to the new time accounting login page.  I
> tried a couple different ways, but to no avail. I have a feeling that
> this is probably the right way to do it, but I'm new to all this
> server-side stuff.  Is this the right approach and if so, what do I
> put in my web.xml?
> 
> Thanks in advance,
>    Jer
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


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