You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ma...@pg.com on 2001/08/03 19:29:45 UTC

RE: Branch too large, Internal restriction. (?!)

My question is, if this is such a well known problem, why don't the JSP compiler
authors just split up the code into a series of methods.  Better yet, prehaps
the JSP spec should explictly say that a JSP compilier should be able to handle
a page with resultant java code of any size.

Is there something I am overlooking or is there a container implementation that
does this?

mark

Mark R Mascolino
The Procter & Gamble Co.
mascolino.mr@pg.com


                                                                
 Internet Mail Message                                          
 Received from host:                                            
                                                                


                                                                                                                   
                 "Assenza, Chris"                                                                                  
          <ca...@Accessdc.com>                To:  "'struts-user@jakarta.apache.org'"                           
                                         <st...@jakarta.apache.org>                                          
                07/31/01 09:24 AM        cc:     (bcc: Mark Mascolino-MR/PGI)                                      
                Please respond to        Subject:     RE: Branch too large, Internal restriction. (?!)             
                      struts-user                                                                                  
                                                                                                                   
                                                                                                                   




This is an evil error but it's not really Struts' fault. Basically the error
is the fact that a compiled JSP (servlet really) can't have a single method
greater then 64k - but with all those tags being compiled in directly the
size grows pretty large.  I asked this a while back and Martin Cooper was
kind enough to help - his explanation is below.

Note that with Struts 1.0 to solve this all you need to do is pull out a few
html:input, etc. fields and include them using jsp:include - you're problem
will be solved. :)

-Chris

---- From Martin Coooper ----
I am, unfortunately, intimately familiar with this problem.

The problem is that there is a limit on the size of a compiled method in a
Java class file, and that limit is what we're running up against. Recall
that a JSP page is compiled into a servlet, and into essentially only one
method in that servlet. Hence, if your page contains many, many tags, that
method becomes too big, and up comes the exception that you're seeing.

There are a couple of (partial) solutions.

1) Break your giant page up into multiple smaller pages and bring them
together at run time using <jsp:include>. Note that <%...@include> won't work,
because that's a compile-time include, which will get you straight back to
the original problem.

2) Look for places to save on tags. For example, the <html:option> tag was
recently extended to allow the specification of the text to display, so
that you can replace this:

<html:option ... ><bean:message key="foo"/></html:option>

with this:

<html:option ... key="foo"/>

If you have a lot of cases of this pattern, it can help quite a bit. In
addition to the <html:option> tag, some other Struts tags allow the same
shortcut to including the text. Also, you might consider replacing
<html:option> sequences with <html:options> if you can build an appropriate
collection up front.

Unfortunately, we can't use solution (1), because our giant page is almost
entirely one <html:form>. (Please don't ask... :-} ) Many of the <html:*>
tags won't work if they are on a separate page from the <html:form> tag
itself. That means I've spent quite some time on option (2).

We have several of our own tags, too, so that was the next place for me to
look. I discovered that changing some frequently used tags from extending
BodyTagSupport to extending TagSupport, and marking them with
<bodycontent>empty</bodycontent> in the .tld file, made a significant
reduction in generated code size. Of course, this is not always feasible,
but it helped us quite a bit.

One other trick is to create custom tags for frequently used groups of
related elements. For example, I created a simple DatePickerTag which is a
Struts-like tag that combines three drop-down boxes for month, day and
year, with the localized strings obtained from the JVM, and the current
values pulled from a bean.

That's about all I can think of that I've tried so far. All our pages are
now within the limit, but one is very close to breaking it. I really want
to put a "do not touch" notice on that file!

Hope this helps.

--
Martin Cooper


-----Original Message-----
From: sbt@maerskdata.dk [mailto:sbt@maerskdata.dk]
Sent: Tuesday, July 31, 2001 9:16 AM
To: struts-user@jakarta.apache.org
Subject: Branch too large, Internal restriction. (?!)



Having *a lot* of input fields (50+ hidden and non-) on my JSP appearently
results in the exception below. Has anyone seen this one before? Is this
due to WebSphere's outdated version of Jasper? At first I thought it was a
limitation in the WTE only but WAS 3.5.3 throws the same exception.

regards,
S. Bro


----------------------------------------------------------------------------
--------
org.apache.jasper.JasperException: C:\Program Files\IBM\VisualAge for
Java\ide\project_resources\IBM WebSphere Test
Environment\temp\JSP1_1\mywebapp\_persinfo_xjsp.java:19: Branch is too
large, Internal restriction.
public class _persinfo_xjsp extends HttpJspBase {
             ^
1 error

           java.lang.Throwable(java.lang.String)
           java.lang.Exception(java.lang.String)
           javax.servlet.ServletException(java.lang.String)
           org.apache.jasper.JasperException(java.lang.String)
           boolean
com.ibm.ivj.jsp.jasper.compiler.JspDebugPageCompiler.javaToClass(java.lang.S
tring,

java.lang.String, java.io.ByteArrayOutputStream, boolean)
           boolean org.apache.jasper.compiler.Compiler.compile()
           boolean
com.ibm.ivj.jsp.jasper.runtime.JspDebugServlet.compile(org.apache.jasper.com
piler.Compiler,

java.lang.Class)
           boolean
com.ibm.ivj.jsp.jasper.runtime.JspDebugServlet.loadJSP(java.lang.String,
java.lang.String, boolean, javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
           void
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(javax
.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
           void
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet
.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse, boolean)
           void
org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpS
ervletRequest,

javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean)
           void
org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletR
equest,

javax.servlet.http.HttpServletResponse)
           void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servlet.
ServletRequest,

javax.servlet.ServletResponse)
           void com.ibm.servlet.engine.webapp.StrictLifecycleServlet.
_service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.webapp.IdleServletState.service(com.ibm.servlet.engin
e.webapp.StrictLifecycleServlet,

javax.servlet.ServletRequest, javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servlet.S
ervletRequest,

javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.ServletR
equest,

javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
           void
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ibm.se
rvlet.engine.webapp.ServletInstanceReference,

javax.servlet.ServletRequest, javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
           void
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.servle
t.ServletRequest,

javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
           void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(c
om.ibm.servlet.engine.webapp.WebAppRequest,

javax.servlet.http.HttpServletResponse, boolean)
           void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.servlet
.ServletRequest,

javax.servlet.ServletResponse, boolean)
           void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.servlet.
ServletRequest,

javax.servlet.ServletResponse)
           void
org.apache.struts.action.ActionServlet.processActionForward(org.apache.strut
s.action.ActionForward,

org.apache.struts.action.ActionMapping,
org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
           void
org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServle
tRequest,

javax.servlet.http.HttpServletResponse)
           void
org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletR
equest,

javax.servlet.http.HttpServletResponse)
           void
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest
,

javax.servlet.http.HttpServletResponse)
           void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servlet.
ServletRequest,

javax.servlet.ServletResponse)
           void com.ibm.servlet.engine.webapp.StrictLifecycleServlet.
_service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.webapp.IdleServletState.service(com.ibm.servlet.engin
e.webapp.StrictLifecycleServlet,

javax.servlet.ServletRequest, javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servlet.S
ervletRequest,

javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.ServletR
equest,

javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
           void
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ibm.se
rvlet.engine.webapp.ServletInstanceReference,

javax.servlet.ServletRequest, javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
           void
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.servle
t.ServletRequest,

javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
           void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(c
om.ibm.servlet.engine.webapp.WebAppRequest,

javax.servlet.http.HttpServletResponse, boolean)
           void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.servlet
.ServletRequest,

javax.servlet.ServletResponse, boolean)
           void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.servlet.
ServletRequest,

javax.servlet.ServletResponse)
           void
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(java.lang.Obje
ct)

           void
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(java.lan
g.Object)

           void
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(java.lang.S
tring,

com.ibm.servlet.engine.srp.ISRPConnection)
           void
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(com.ibm.ser
vlet.engine.oselistener.api.IOSEConnection)

           void
com.ibm.servlet.engine.http_transport.HttpTransportHandler.handleConnection(
java.net.Socket)

           void
com.ibm.servlet.engine.http_transport.HttpTransportHandler.run()
           void java.lang.Thread.run()






Re: Reaching Action class from Href Link

Posted by Martin Cooper <ma...@tumbleweed.com>.
Yes, that's correct. Using extension mapping with Struts, and ".do" in 
particular, is just a Struts convention. I suspect that most people are 
probably following that convention, but it is not a requirement. You are 
free to use a different extension, such as ".act" or ".cmd" or whatever, or 
to use path mapping, if you want.

As you point out, changing the mapping method or the extension after the 
project is in development may have repercussions, so it's a decision you 
really want to make up front, and stick with.

--
Martin Cooper


At 02:09 PM 8/3/01, John M. Corro wrote:
>Ken clarified my point - that in a form's 'action' you don't need to tack
>the '.do' extension to the end of the action mapping (ie
>action="SomeAction").  In a link's 'href' value you do need to tack on the
>'do' extension (ie the value changes to href="SomeAction.do").
>
>I believe this comes w/ a caveat as the '.do' extension can be changed.  By
>default the extension is '.do' in the web.xml file.  I haven't tried this,
>but I would imagine if you changed the extension in the web.xml file, you'd
>have to also reflect the change in your links.
>
>----- Original Message -----
>From: "Greg Maletic" <gr...@ZeroG.com>
>To: <st...@jakarta.apache.org>
>Sent: Friday, August 03, 2001 11:57 AM
>Subject: RE: Reaching Action class from Href Link
>
>
> > Now I'm really confused!  Your original problem was that you wanted to
>have
> > a link forward to an action.  Your clarification shows how to do it from a
> > form ("<form action="SomeAction>"), but then you say that using a link or
> > href will not work.  That doesn't seem to solve your original problem,
>does
> > it?
> >
> > Please let me know what I'm missing here, because I'm having this problem
>as
> > well.
> >
> > Thanks!
> >
> >
> > -----Original Message-----
> > From: struts-user-return-14610-greg.maletic=zerog.com@jakarta.apache.org
> > [mailto:struts-user-return-14610-greg.maletic=zerog.com@jakarta.apache.o
> > rg]On Behalf Of John M. Corro
> > Sent: Friday, August 03, 2001 1:33 PM
> > To: struts-user@jakarta.apache.org
> > Subject: Re: Reaching Action class from Href Link
> >
> >
> > Thanks to John and Ken for the assistance.
> >
> > Point of clarification other interested newbies, using a form's 'action'
> > value as the link's 'href' value will not work - the reason mine wasn't
> > working.  For instance,
> >
> > <form action="SomeAction">
> >
> > may work, where as
> >
> > <a href="SomeAction">~~~</a> or <html:link
>href="SomeAction"~~~></html:link>
> >
> > will not.
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "John Schroeder" <js...@quovera.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Friday, August 03, 2001 11:22 AM
> > Subject: RE: Reaching Action class from Href Link
> >
> >
> > > Using the struts html:form tag will set the method to POST by default.
> > This
> > > won't prevent you from using the link as you describe though.  The
>service
> > > methods of an HttpServlet doPost() and doGet() will accomplish
>essentially
> > > the same goal (often doGet() will just call doPost() ).  In the case of
> > the
> > > struts ActionServlet, both of these methods call process().  So you can
> > use
> > > a query string to pass your parameters (or extra path info if you wish).
> > >
> > > So, that was a little long-winded way of saying that your link can look
> > > like:
> > > <a
>href="/someContext/someAction.do?param1=foo&param2=bar&param3=baz">LINK
> > > TEXT</a>
> > >
> > > Hope this helps!!
> > >
> > > --John
> > >
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: John M. Corro [mailto:john.corro@cornerstone.net]
> > > Sent: Friday, August 03, 2001 1:07 PM
> > > To: struts-user@jakarta.apache.org
> > > Subject: Reaching Action class from Href Link
> > >
> > >
> > > I've recently begun working with Struts and am looking to create a
> > scenario
> > > where a user can click on a link and trigger some event in an Action
>class
> > > (ie the clicking of a link would be the same as clicking a form's submit
> > > button).  My understanding is that within Struts forms submit by the
>post
> > > method by default so I don't know if the only way to reach an Action
>class
> > > is by an actual form.  Any one have any insight?
> > >
> > >
> > >
> >
> >
> >



Re: Reaching Action class from Href Link

Posted by "John M. Corro" <jo...@cornerstone.net>.
Ken clarified my point - that in a form's 'action' you don't need to tack
the '.do' extension to the end of the action mapping (ie
action="SomeAction").  In a link's 'href' value you do need to tack on the
'do' extension (ie the value changes to href="SomeAction.do").

I believe this comes w/ a caveat as the '.do' extension can be changed.  By
default the extension is '.do' in the web.xml file.  I haven't tried this,
but I would imagine if you changed the extension in the web.xml file, you'd
have to also reflect the change in your links.

----- Original Message -----
From: "Greg Maletic" <gr...@ZeroG.com>
To: <st...@jakarta.apache.org>
Sent: Friday, August 03, 2001 11:57 AM
Subject: RE: Reaching Action class from Href Link


> Now I'm really confused!  Your original problem was that you wanted to
have
> a link forward to an action.  Your clarification shows how to do it from a
> form ("<form action="SomeAction>"), but then you say that using a link or
> href will not work.  That doesn't seem to solve your original problem,
does
> it?
>
> Please let me know what I'm missing here, because I'm having this problem
as
> well.
>
> Thanks!
>
>
> -----Original Message-----
> From: struts-user-return-14610-greg.maletic=zerog.com@jakarta.apache.org
> [mailto:struts-user-return-14610-greg.maletic=zerog.com@jakarta.apache.o
> rg]On Behalf Of John M. Corro
> Sent: Friday, August 03, 2001 1:33 PM
> To: struts-user@jakarta.apache.org
> Subject: Re: Reaching Action class from Href Link
>
>
> Thanks to John and Ken for the assistance.
>
> Point of clarification other interested newbies, using a form's 'action'
> value as the link's 'href' value will not work - the reason mine wasn't
> working.  For instance,
>
> <form action="SomeAction">
>
> may work, where as
>
> <a href="SomeAction">~~~</a> or <html:link
href="SomeAction"~~~></html:link>
>
> will not.
>
>
>
>
> ----- Original Message -----
> From: "John Schroeder" <js...@quovera.com>
> To: <st...@jakarta.apache.org>
> Sent: Friday, August 03, 2001 11:22 AM
> Subject: RE: Reaching Action class from Href Link
>
>
> > Using the struts html:form tag will set the method to POST by default.
> This
> > won't prevent you from using the link as you describe though.  The
service
> > methods of an HttpServlet doPost() and doGet() will accomplish
essentially
> > the same goal (often doGet() will just call doPost() ).  In the case of
> the
> > struts ActionServlet, both of these methods call process().  So you can
> use
> > a query string to pass your parameters (or extra path info if you wish).
> >
> > So, that was a little long-winded way of saying that your link can look
> > like:
> > <a
href="/someContext/someAction.do?param1=foo&param2=bar&param3=baz">LINK
> > TEXT</a>
> >
> > Hope this helps!!
> >
> > --John
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: John M. Corro [mailto:john.corro@cornerstone.net]
> > Sent: Friday, August 03, 2001 1:07 PM
> > To: struts-user@jakarta.apache.org
> > Subject: Reaching Action class from Href Link
> >
> >
> > I've recently begun working with Struts and am looking to create a
> scenario
> > where a user can click on a link and trigger some event in an Action
class
> > (ie the clicking of a link would be the same as clicking a form's submit
> > button).  My understanding is that within Struts forms submit by the
post
> > method by default so I don't know if the only way to reach an Action
class
> > is by an actual form.  Any one have any insight?
> >
> >
> >
>
>
>


RE: Reaching Action class from Href Link

Posted by Greg Maletic <gr...@ZeroG.com>.
Now I'm really confused!  Your original problem was that you wanted to have
a link forward to an action.  Your clarification shows how to do it from a
form ("<form action="SomeAction>"), but then you say that using a link or
href will not work.  That doesn't seem to solve your original problem, does
it?

Please let me know what I'm missing here, because I'm having this problem as
well.

Thanks!


-----Original Message-----
From: struts-user-return-14610-greg.maletic=zerog.com@jakarta.apache.org
[mailto:struts-user-return-14610-greg.maletic=zerog.com@jakarta.apache.o
rg]On Behalf Of John M. Corro
Sent: Friday, August 03, 2001 1:33 PM
To: struts-user@jakarta.apache.org
Subject: Re: Reaching Action class from Href Link


Thanks to John and Ken for the assistance.

Point of clarification other interested newbies, using a form's 'action'
value as the link's 'href' value will not work - the reason mine wasn't
working.  For instance,

<form action="SomeAction">

may work, where as

<a href="SomeAction">~~~</a> or <html:link href="SomeAction"~~~></html:link>

will not.




----- Original Message -----
From: "John Schroeder" <js...@quovera.com>
To: <st...@jakarta.apache.org>
Sent: Friday, August 03, 2001 11:22 AM
Subject: RE: Reaching Action class from Href Link


> Using the struts html:form tag will set the method to POST by default.
This
> won't prevent you from using the link as you describe though.  The service
> methods of an HttpServlet doPost() and doGet() will accomplish essentially
> the same goal (often doGet() will just call doPost() ).  In the case of
the
> struts ActionServlet, both of these methods call process().  So you can
use
> a query string to pass your parameters (or extra path info if you wish).
>
> So, that was a little long-winded way of saying that your link can look
> like:
> <a href="/someContext/someAction.do?param1=foo&param2=bar&param3=baz">LINK
> TEXT</a>
>
> Hope this helps!!
>
> --John
>
>
>
>
>
> -----Original Message-----
> From: John M. Corro [mailto:john.corro@cornerstone.net]
> Sent: Friday, August 03, 2001 1:07 PM
> To: struts-user@jakarta.apache.org
> Subject: Reaching Action class from Href Link
>
>
> I've recently begun working with Struts and am looking to create a
scenario
> where a user can click on a link and trigger some event in an Action class
> (ie the clicking of a link would be the same as clicking a form's submit
> button).  My understanding is that within Struts forms submit by the post
> method by default so I don't know if the only way to reach an Action class
> is by an actual form.  Any one have any insight?
>
>
>



Re: Reaching Action class from Href Link

Posted by Martin Cooper <ma...@tumbleweed.com>.
If you use the Struts <html:form> tag, the value of the 'action' attribute 
is used to look up the corresponding action mapping, and Struts will append 
the ".do" if you are using extension mapping for your servlet.

If you use the Struts <html:link> tag with the 'href' attribute, then that 
value is taken literally. You have a bit more flexibility if you use the 
'forward' or 'page' attributes with this tag.

--
Martin Cooper


At 01:32 PM 8/3/01, John M. Corro wrote:
>Thanks to John and Ken for the assistance.
>
>Point of clarification other interested newbies, using a form's 'action'
>value as the link's 'href' value will not work - the reason mine wasn't
>working.  For instance,
>
><form action="SomeAction">
>
>may work, where as
>
><a href="SomeAction">~~~</a> or <html:link href="SomeAction"~~~></html:link>
>
>will not.
>
>
>
>
>----- Original Message -----
>From: "John Schroeder" <js...@quovera.com>
>To: <st...@jakarta.apache.org>
>Sent: Friday, August 03, 2001 11:22 AM
>Subject: RE: Reaching Action class from Href Link
>
>
> > Using the struts html:form tag will set the method to POST by default.
>This
> > won't prevent you from using the link as you describe though.  The service
> > methods of an HttpServlet doPost() and doGet() will accomplish essentially
> > the same goal (often doGet() will just call doPost() ).  In the case of
>the
> > struts ActionServlet, both of these methods call process().  So you can
>use
> > a query string to pass your parameters (or extra path info if you wish).
> >
> > So, that was a little long-winded way of saying that your link can look
> > like:
> > <a href="/someContext/someAction.do?param1=foo&param2=bar&param3=baz">LINK
> > TEXT</a>
> >
> > Hope this helps!!
> >
> > --John
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: John M. Corro [mailto:john.corro@cornerstone.net]
> > Sent: Friday, August 03, 2001 1:07 PM
> > To: struts-user@jakarta.apache.org
> > Subject: Reaching Action class from Href Link
> >
> >
> > I've recently begun working with Struts and am looking to create a
>scenario
> > where a user can click on a link and trigger some event in an Action class
> > (ie the clicking of a link would be the same as clicking a form's submit
> > button).  My understanding is that within Struts forms submit by the post
> > method by default so I don't know if the only way to reach an Action class
> > is by an actual form.  Any one have any insight?
> >
> >
> >



Re: Reaching Action class from Href Link

Posted by "John M. Corro" <jo...@cornerstone.net>.
Thanks to John and Ken for the assistance.

Point of clarification other interested newbies, using a form's 'action'
value as the link's 'href' value will not work - the reason mine wasn't
working.  For instance,

<form action="SomeAction">

may work, where as

<a href="SomeAction">~~~</a> or <html:link href="SomeAction"~~~></html:link>

will not.




----- Original Message -----
From: "John Schroeder" <js...@quovera.com>
To: <st...@jakarta.apache.org>
Sent: Friday, August 03, 2001 11:22 AM
Subject: RE: Reaching Action class from Href Link


> Using the struts html:form tag will set the method to POST by default.
This
> won't prevent you from using the link as you describe though.  The service
> methods of an HttpServlet doPost() and doGet() will accomplish essentially
> the same goal (often doGet() will just call doPost() ).  In the case of
the
> struts ActionServlet, both of these methods call process().  So you can
use
> a query string to pass your parameters (or extra path info if you wish).
>
> So, that was a little long-winded way of saying that your link can look
> like:
> <a href="/someContext/someAction.do?param1=foo&param2=bar&param3=baz">LINK
> TEXT</a>
>
> Hope this helps!!
>
> --John
>
>
>
>
>
> -----Original Message-----
> From: John M. Corro [mailto:john.corro@cornerstone.net]
> Sent: Friday, August 03, 2001 1:07 PM
> To: struts-user@jakarta.apache.org
> Subject: Reaching Action class from Href Link
>
>
> I've recently begun working with Struts and am looking to create a
scenario
> where a user can click on a link and trigger some event in an Action class
> (ie the clicking of a link would be the same as clicking a form's submit
> button).  My understanding is that within Struts forms submit by the post
> method by default so I don't know if the only way to reach an Action class
> is by an actual form.  Any one have any insight?
>
>
>


RE: Reaching Action class from Href Link

Posted by John Schroeder <js...@quovera.com>.
Using the struts html:form tag will set the method to POST by default.  This
won't prevent you from using the link as you describe though.  The service
methods of an HttpServlet doPost() and doGet() will accomplish essentially
the same goal (often doGet() will just call doPost() ).  In the case of the
struts ActionServlet, both of these methods call process().  So you can use
a query string to pass your parameters (or extra path info if you wish).

So, that was a little long-winded way of saying that your link can look
like:
<a href="/someContext/someAction.do?param1=foo&param2=bar&param3=baz">LINK
TEXT</a>

Hope this helps!!

--John





-----Original Message-----
From: John M. Corro [mailto:john.corro@cornerstone.net]
Sent: Friday, August 03, 2001 1:07 PM
To: struts-user@jakarta.apache.org
Subject: Reaching Action class from Href Link


I've recently begun working with Struts and am looking to create a scenario
where a user can click on a link and trigger some event in an Action class
(ie the clicking of a link would be the same as clicking a form's submit
button).  My understanding is that within Struts forms submit by the post
method by default so I don't know if the only way to reach an Action class
is by an actual form.  Any one have any insight?



Reaching Action class from Href Link

Posted by "John M. Corro" <jo...@cornerstone.net>.
I've recently begun working with Struts and am looking to create a scenario
where a user can click on a link and trigger some event in an Action class
(ie the clicking of a link would be the same as clicking a form's submit
button).  My understanding is that within Struts forms submit by the post
method by default so I don't know if the only way to reach an Action class
is by an actual form.  Any one have any insight?





RE: Branch too large, Internal restriction. (?!)

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 3 Aug 2001 mascolino.mr@pg.com wrote:

> 
> My question is, if this is such a well known problem, why don't the
> JSP compiler authors just split up the code into a series of methods.  
> Better yet, prehaps the JSP spec should explictly say that a JSP
> compilier should be able to handle a page with resultant java code of
> any size.
> 

If only it were that easy ...

The biggest problem is with the scope of scripting variables that are
exposed by tags like <jsp:useBean>.  Among the things that happens when
your page is compiled, this is implemented as a local variable inside the
_jspService() method.  If you've split _jspService() into multiple small
methods, and then try to reference those scripting variables in a spot
that's in a different method than where <jsp:useBean> was processed,
you're out of luck.

It will take some relatively sophisticated analysis of the input page to
know whether or not it's safe to split up the code into separate
methods.  The JSP compiler used in Tomcat and several other containers
(Jasper) isn't yet up to this task, because it does not keep any sort of
global model of the page over which it can perform such an analysis.

> Is there something I am overlooking or is there a container
> implementation that does this?
> 
> mark
> 
> Mark R Mascolino
> The Procter & Gamble Co.
> mascolino.mr@pg.com
> 

Craig McClanahan (whose "day job" is working on Tomcat)