You define a plugin with a constant named "extensionId" that has some unique
name, inside that plugin you define your actions like

<constant name="extensionId" value="myplugin"

<action ... namespace="myplugin/otherstuff">
  <interceptor-ref name="extensions" />
  <result>${extensionId}/MyJsp.jsp</result>
</action>

where MyJsp.jsp is a jsp that will be in a subdir under "s2resources". I
have a context listener that searches the class path for the "s2resources"
folder and uncompress it beneath a folder with the name defined in the
"extensionId" constant. When the action is invoked, the interceptor
"extensions" will get the first part of the namespace, in this case
"myplugin" and build the path to the subfolder that has the resources for
this plugin, and push it into the Value Stack with the name "extensionId" so
the result path points to the right jsp. I can post the code if anyone is
interested. At the end I think it is just easier to use FreeMarker which
works from inside the classpath.

musachy

//I did say it was a hack right? :)

On 4/25/07, Leon Rosenberg <[EMAIL PROTECTED]> wrote:

another cheap workaround i'm currently using, is to unpack the jsps
from jars in the ant script which builds the war file:

<unjar src="${packlib}/moskito-webui-jsps.jar" dest="${output.webapp }"/>

in this case the jar file was specially prepared previously, but you
can also tell unjar task to unjar the jsps only.

regards
Leon


On 4/25/07, Zoran Avtarovski < [EMAIL PROTECTED]> wrote:
> Just an idea, but couldn't you use pre-compiled jsp pages. This way
they're
> available as servlets.
>
> I remember looking at the Jrun admin console which uses precompiled
jsps.
>
> Z.
>
> > Do you have anything on the forwarding to a JSP in a JAR file that you
> > can tell us about?  I'm running into the same situation where I work
> > and can't figure out a solution.  I had thought that maybe if I
> > forwarded to something like /struts/jsps/test.jsp and add the package
> > that jsps are contained in to the filter I could access it that way.
> > That sort of works.  What I wind up getting is the unparsed JSP.  So,
> > I was thinking that I could instead extract the JSP I'm trying to get
> > to the filesystem and forward to that, but that seems messy.
> >
> > Did you find a good way to accomplish this?
> >
> > Thanks,
> > Rich
> >
> > Musachy Barroso wrote:
> >> I'm working on an Struts plugin to try to work around (more like
> >> hack around)  that and other fun stuff :)
> >>
> >> musachy
> >>
> >> On 4/10/07, Laurie Harper <[EMAIL PROTECTED]> wrote:
> >>>
> >>> Frank W. Zammetti wrote:
> >>>> Quick question... can anyone tell me if it's possible to
> >>>> forward
> >>> to a
> >>>> JSP that is stored in a JAR file (i.e., in a JAR located in
> >>>> WEB-INF/lib), and if so, how?  I couldn't find a quick answer
> >>>> on the first few pages of Googling, figured someone here would
> >>>> probably
> >>> know
> >>>> off the top of their heads.  Thanks!
> >>>
> >>> Not in any standard way, no. There may be container-specific
> >>> solutions, but you'd be working outside the spec.
> >>>
> >>> L.
> >>>
> >>>
> >>>
---------------------------------------------------------------------
> >>>  To unsubscribe, e-mail: [EMAIL PROTECTED] For
> >>> additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Reply via email to