Hi all,

A very strange thing is happening. All of my JSP pages include this
header.inc. In it is mostly html, but it is where I contain most of the
scriplet code to show the "header" menu that stays consistent on our site,
other than color changes depending on location in the menu.

I hope nobody minds, but I will post a bit of the scriplet that seems to be
causing this strange "run-on" method.

  if( loginFlag > 0 )
  {
%>
  <jsp:useBean id="loginbean" scope="request"
class="com.bm.ui.beans.LoginBean" />
  <jsp:setProperty name="loginbean" property="*" />
<%
    if( request.getParameter("login") != null )
      loginbean.login(request, response);
  }


The loginFlag is set in every file to a value of 0 (no login menu appears)
or 1 (login flag appears). A 2 is a special case for the MAIN home page, and
at this very moment I forget why..but I think it was to "clear" an object or
something.

At any rate, I turned on development to see why Orion was telling me a
method is larger than 64K. Here is a very small snippet of the "start" of
it.


----------------------------------------------------------------------------

  if( loginFlag > 0 )
  {
                        com.bm.ui.beans.LoginBean loginbean =
(com.bm.ui.beans.LoginBean)request.getAttribute("loginbean");
                        if(loginbean == null)
                        {
                                        loginbean = new com.bm.ui.beans.LoginBean();
                                request.setAttribute("loginbean", loginbean);
                        }
                        _tempString = request.getParameter("redirectUrl");
                        if(_tempString != null) loginbean.setRedirectUrl(_tempString);
                        _tempString = request.getParameter("loginName");
                        if(_tempString != null) loginbean.setLoginName(_tempString);
                        _tempString = request.getParameter("loginPassword");
                        if(_tempString != null) 
loginbean.setLoginPassword(_tempString);
                        try
                        {
                                _tempString = request.getParameter("mediamediaType");
                                if(_tempString != null)
loginbean.getMedia().setMediaType(Integer.parseInt(_tempString));
                        }
                        catch(NumberFormatException e) {}
                        try
                        {
                                _tempString = 
request.getParameter("connectiontransactionIsolation");
                                if(_tempString != null)
loginbean.getConnection().setTransactionIsolation(Integer.parseInt(_tempStri
ng));
                        }
                        catch(NumberFormatException e) {}
                        _tempString = request.getParameter("connectionautoCommit");
loginbean.getConnection().setAutoCommit("on".equalsIgnoreCase(_tempString));
                        _tempString = request.getParameter("connectioncatalog");
                        if(_tempString != null)
loginbean.getConnection().setCatalog(_tempString);
                        _tempString = request.getParameter("connectionreadOnly");
loginbean.getConnection().setReadOnly("on".equalsIgnoreCase(_tempString));

------------------------------------------------------------------------

It goes on an on like this until the very end of the file. There has to be
over 500 try..catch blocks.

So..can anyone make light of this? My "best" guess is that the Servlet 2.2
syntax uses the setAttribute and getAttribute calls and I am making a call
to request.getParameter(). I havent tried changing this, mainly because I
need JSP 1.0 functionality on my site at this point. Yes..I know, to be J2EE
compliant it will be Servlet 2.2, JSP 1.1, etc. But for now, I just want to
see it run under Orion. Is this possible? Or does the getParameter() call
not exist at all anymore in servlet 2.2 spec?

As far as I know, its ok to do something like:

<%
  if( some condition )
  {
%>
  <jsp:useBean id="mybean" scope="request" class="com.bm.ui.beans.MyBean" />
  <jsp:setProperty name="mybean" property="*" />
<%
  }
%>

Or is that not allowed? It does work on our JSP 1.0 based site right now. Is
the ongoing method a bug in Orion?

Thanks.

Reply via email to