You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Howard M. Lewis Ship" <hl...@attbi.com> on 2003/02/06 23:17:33 UTC

RE: [Tapestry-developer] Integrating JSP / Tapestry

Yes, I would like to make this easier.

Currently, the page and external services are simple enough that you can
second-guess Tapestry on how to form a URL.  It would be better, though,
that the same code be used inside Tapestry, and in JSP tags used to access
Tapestry pages.

Ideally, it should be possible (for the page and external services) to make
use of the actual Tapestry services to render the HTML links.  That is,
create JSP tags that use the same objects as Tapestry to create URLs.

I think, for this to work, the Tapestry servlet should register some kind of
object in the ServletContext, accessible to the JSP tags, with whatever
information or hooks are needed.  I'll noodle on this as yet another
improvement for 2.4.

I could envision a tag usage like:

  <tapestry:pagelink application="ecommerce"
page="Checkout">checkout</tapestry:pagelink>

This would be the equivalent of

  <a href="#" jwcid="@PageLink" page="Checkout">checkout</a>

Within the ecommerce application.

There might also be a way omit the application tag parameter in the common
case that there is only a single Tapestry application.  Or there might need
to be more parameters for cases where JSP app in servlet container #1 (or
even servlet context #1) needs to connect to Tapestry application in
container/context #2.  Perhaps we can build up to that kind of complexity.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/proposals/tapestry



-----Original Message-----
From: tapestry-developer-admin@lists.sourceforge.net
[mailto:tapestry-developer-admin@lists.sourceforge.net] On Behalf Of Malcolm
Edgar
Sent: Thursday, February 06, 2003 3:55 PM
To: Joel@SmartPrice.com
Cc: tapestry-developer@lists.sourceforge.net
Subject: Re: [Tapestry-developer] Integrating JSP / Tapestry


Hi Joel,

This question has come up before. Yes JSP's and Tapestry can coexist in an
application, I have done this in a small application. From tapestry you 
can get all the Servlet API stuff from the RequestContext:

public void formSubmit(IRequestCycle cycle) {
      RequestContext context = cycle.getRequestContext();

      HttpSession session = context.getSession();
      HttpServletRequest request = context.getRequest();
      HttpServletResponse response = context.getResponse();
   }
}

If you want to call Tapestry pages from you JSP I would recommend you use 
IExternalPage. The ExternalService details the URL you would need to create 
in you JSP link to do this. Its pretty simple and handy. Note there is also 
an ExternalCallback & ExternalLink component.

regards Malcolm

>From: Joel Trunick <Jo...@SmartPrice.com>
>To: "'tapestry-developer@lists.sourceforge.net'"
><ta...@lists.sourceforge.net>
>Subject: [Tapestry-developer] Integrating JSP / Tapestry
>Date: Wed, 5 Feb 2003 16:01:31 -0600
>
>
>We have a fairly large site that was built using JSP (before I was 
>here). However, we are about to change out the "second half" of our 
>pages (order checkout pages). I was wondering if it is possible (and 
>how painful) to switch to Tapestry for our last set of pages. We have 
>info in session and request (order info) that would need to carry 
>through to the Tapestry pages.
>
>Is Tapestry all or nothing? How can we start moving to Tapestry?
>
>Thanks,
>Joel Trunick
>http://www.smartprice.com/


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com _______________________________________________
Tapestry-developer mailing list Tapestry-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tapestry-developer