> Methinks the confusion in this thread is being compuonded
> by the top-posting style of each of the respondents, but note that..
[quoted text clipped - 11 lines]
>
> Andrew T.
hi Andrew, long time no talk, this is Frances, posting under a different
name (for various reasons.. all innocuous ...;)
first of all, I did change my if-clause to your above line,
if (theSponsor == null || theSponsor.trim().equals("") ) {
thank you.. (I had forgotten that null-test should always go first..)
it turns out that, just as I thought, this problem has to do w/tiles and
variable scope; don't know if you know struts/tiles, I just learned,
after talking to a knowledgeable java guy here, that each tile gets
converted into a different servlet, which raises a whole lot of
variable-scope issues (since then presumably there is a different
jsp_service() method for EACH TILE...)
what I ended up doing:
in controller page (page that calls the tiles, don't know if this
correct terminology, this is what we call them here):
<%
String theSponsor = "";
theSponsor = request.getParameter("sponsor");
if (theSponsor == null || theSponsor.trim().equals("") ) {
response.sendRedirect("/ws/sponsors/index.jsp");
}
%>
tiles-code here...
in tile itself then, had to declare a new var to grab same param but
with a different name, thus:
<%
String theSponsorA = "";
theSponsorA = request.getParameter("sponsor");
if (theSponsorA != null || !theSponsorA.trim().equals("") ) {
%>
CUSTOM-TAG HERE, with var above as a param-value..
<% } %>
hope this makes sense, at any rate this is what worked...
thank you for your help..
maya - 05 Jan 2007 16:11 GMT
>> Methinks the confusion in this thread is being compuonded
>> by the top-posting style of each of the respondents, but note that..
[quoted text clipped - 57 lines]
>
> thank you for your help..
btw, whole reason I had to do what I ended up doing is that java guy
here told me redirects don't work in tiles, only in controller pages..
I have a WHOLE LOT of struts still to learn (as this is all we do here,
different job, started here last August..)
Lew - 06 Jan 2007 02:56 GMT
>> <%
>> String theSponsor = "";
[quoted text clipped - 5 lines]
>
> I have a WHOLE LOT of struts still to learn (as this is all we do here,
To start with, you need to learn to let Struts handle the navigation instead
of hard-coding it into the JSP.
The whole point of Struts is that it implements the Model-View-Controller
(MVC) paradigm, also called "Model 2 architecture" by Sun. The controller
servlet should handle *all* navigation, not the JSPs. JSPs are supposed to be
for view only, no model code, no navigation.
- Lew