Hi,

there is currently no way to jump directly to a subcomponent. But there is a 
easy workaround. MapUrl can take additional parameters, which can be used to 
pass parts of the url to the component. The first additional parameter 
specifies the path info, accessible with "request.getPathInfo()". This is a 
way to pass parts of the request url to the application.

And here is a step-by-step solution:
In tntnet.conf you specify your url schema:
        MapUrl      ^/([^.]+)/([^.]+)$   [EMAIL PROTECTED] $2
This maps /foo/comp1 to [EMAIL PROTECTED] passing comp1 as path info.

You write a component as you suggested with a little main code part and your 
subcomponents:
% return callSubComp(request.getPathInfo(), request, reply, qparam);
<%def comp1> ... <%/def>
<%def comp2> ... <%/def>
<%def comp3> ... <%/def>

The main part uses the path info to choose the right subcomponent. You may as 
well use the <& ... >-syntax here, but the solution above is a litte more 
efficient and you don't need to know the name and library of the current 
component, although you may use "getCompident()" to get a object, which 
contains the current component and library name.

When the component above is called "foo" and linked into the library mylib, 
the url /foo/comp1 calls your comp1-subcomponent.

Tommi

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to