struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghuveer Rawat" <techhel...@gmail.com>
Subject Re: Action servlet becomes null in UNIX environment
Date Wed, 07 May 2008 18:44:31 GMT
Thanks for the prompt reply. Its a late 90's   huge application in which now
i cannot start using Strus 2  as iam the only developer working on this. We
are using html in java code because the JSP changes at run time according to
the user inputs . Yeah , i agree that coz of diff environment we face lot of
problems but i cannot do anything as its not my decision.
We  run Apache as a front end for Tomcat. Apache serves up the html pages
and uses mod_jk mounts to forward the java application requests to Tomcat.
I'll try to find out what else i can do as i am unable to see anything in
apache logs as well.

On Wed, May 7, 2008 at 1:48 PM, Allen, Daniel <Daniel.Allen@kbcfp.com>
wrote:

> A couple of things strike me as really odd about this.
>
> First: why are you creating HTML using strings in Java code? The whole
> point of JSPs was to avoid doing exactly that. You should either make
> use of .jsp files and the logic tags in Struts [1] or just use regular
> servlets if you really want to manually compose HTML.
>
> Second, why is your test environment different from your production
> environment? That sort of defeats the purpose of testing, since you can
> no longer rely on the fact that something you tested works.
>
>
> That said, chances are pretty good that you're getting null from that
> line because the HTTP request represented by the request object didn't
> have a parameter called "actionSelection". I suggest you stick in a
> breakpoint and have a look at the contents of the object.
>
> Hope that helps.
> ~DVA
>
> [1] http://struts.apache.org/1.3.8/struts-taglib/index.html Looks as
> though you're using Struts 1, but you didn't specify a version, so
> here's the last release's tag documents. If this is a new app, may I
> humbly suggest you use Struts2 instead?  No sense in starting a project
> using a deprecated framework.
>
>
> -----Original Message-----
> From: Raghuveer Rawat [mailto:techhelp07@gmail.com]
> Sent: Wednesday, May 07, 2008 1:18 PM
> To: Struts Users Mailing List
> Subject: Action servlet becomes null in UNIX environment
>
> Hi,
> I have a problem with my application where actionServlet becomes null in
> UNIX environment and works fine in windows XP system. While saving data
> on
> test environment (UNIX) I am getting action servlet as null in My Action
> class. The jsp is built dynamically in as below
>
> *JSP code:*
>
> if (newGuide) {
>
> sb.append("<tr>\n");
>
> sb.append("<td align=right colspan=2>\n");
>
> sb.append("<select name=\"actionSelection\">");
>
> sb.append(" <option value=saveOnly>- Save Assessment</option>");
>
> sb.append(" <option value=delete>- Delete Assessment</option>");
>
> sb.append(" <option value=saveSchedule>- Save & Schedule</option>");
>
> sb.append(" <option value=saveRefer>- Save & Refer</option>");
>
> sb.append("</select>");
>
> sb.append(" <input type=\"submit\" name=\"save\"
>
> value=\"Complete\" class=Button >");
>
> sb.append("</td>\n");
>
> sb.append("</tr>\n");
>
> }
>
> * Action Class // Action class used for security *
>
> public void setServlet(ActionServlet actionServlet) {
>
> super.setServlet(actionServlet); // Here I get actionServlet as null
>
> ServletContext servletContext = actionServlet.getServletContext();
>
> WebApplicationContext wac = WebApplicationContextUtils
>
> .getRequiredWebApplicationContext(servletContext);
>
> setIcrProcessor((CareRequestProcessor)wac.getBean("myCareRequestProcesso
>
> r"));
>
> }
>
> Because of this I get null pointer exception in class Main Action Class
> used
> for saving the data.
>
> *Action class code :*
>
> public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form,
> HttpServletRequest request,
>
> HttpServletResponse response) throws Exception {
>
> String method = "saveHAGuide";
>
> Exception ex = null;
>
> ActionForward forward = null;
>
> AppUser appUser = getAppUser(request);
>
> appUser.methodStart(this, "saveHAGuide");
>
> HttpSession session = request.getSession(false);
>
> String action = request.getParameter("actionSelection"); // Here I get
> action as null
>
> Action becomes null and it throws null pointer exception.
>
> As UNIX is case sensitive I checked the request parameter which is
> actionSelection in this class and I do not see any problem with it. I
> don't
> know why action servlet becomes null at this point. Please suggest if
> you
> have any idea about this.
>
> Note: This happens only in test environment (UNIX). Works fine in my
> local
> system (Windows XP) .
>
> Thanks and regards,
>
> --
> This message may contain confidential, proprietary, or legally privileged
> information. No confidentiality or privilege is waived by any transmission
> to an unintended recipient. If you are not an intended recipient, please
> notify the sender and delete this message immediately. Any views expressed
> in this message are those of the sender, not those of any entity within the
> KBC Financial Products group of companies (together referred to as "KBC
> FP").
>
> This message does not create any obligation, contractual or otherwise, on
> the part of KBC FP. It is not an offer (or solicitation of an offer) of, or
> a recommendation to buy or sell, any financial product. Any prices or other
> values included in this message are indicative only, and do not necessarily
> represent current market prices, prices at which KBC FP would enter into a
> transaction, or prices at which similar transactions may be carried on KBC
> FP's own books. The information contained in this message is provided "as
> is", without representations or warranties, express or implied, of any kind.
> Past performance is not indicative of future returns.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message