Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 18 Aug 2008 12:00:24 -0000 Issue 8198

user-digest-help

2008-08-18


Author LoginPost Reply

user Digest 18 Aug 2008 12:00:24 -0000 Issue 8198

Topics (messages 190136 through 190148):

struts2 getInputForward()
 190136 by: wanginfo
 190137 by: Umar Bilal
 190138 by: Nils-Helge Garli Hegvik
 190144 by: "Stephan Schröder"

Re: Struts2 Application Structure
 190139 by: "Stephan Schröder"

Re: [S2] 2.1.3GA?
 190140 by: "Stephan Schröder"

Re: NullPointer Exception On IE7
 190141 by: Dave Newton
 190147 by: Pranab

Re: problem with checkbox
 190142 by: Dave Newton
 190146 by: Muralidhar Y

Re: Object put in HttpSession can't be found by S2
 190143 by: Ylva Degerfeldt

Re: simple ajax form - returns value to a new page (not to a DIV)
 190145 by: Jeromy Evans

Hi problem no configration found.
 190148 by: Muralidhar Y

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

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

Attachment: user_190136.ezm (zipped)
how do i return to an actions input page/action? in struts1 there was the mapping.getInputForward() method, maybe i'm blind but i haven't found an equivalent in struts2.

thanks in advance.

Attachment: user_190137.ezm (zipped)
Use a forward tag in the Strut config action. Like <forward
name="success" path=/"whateverActionYouNeed.do"/>

Take care
Bye


-----Original Message-----
From: wanginfo [mailto:wanginfo@(protected)]
Sent: Monday, August 18, 2008 3:01 PM
To: Struts Mail List
Subject: struts2 getInputForward()

how do i return to an actions input page/action? in struts1 there was
the mapping.getInputForward() method, maybe i'm blind but i haven't
found an equivalent in struts2.

thanks in advance.

Attachment: user_190138.ezm (zipped)
Maybe these resources can help:

http://struts.apache.org/2.x/docs/bootstrap.html
http://struts.apache.org/2.x/docs/selecting-results.html
http://struts.apache.org/2.x/docs/result-configuration.html
http://struts.apache.org/2.x/docs/result-types.html

Nils-H

On Mon, Aug 18, 2008 at 11:31 AM, wanginfo <wanginfo@(protected):
> how do i return to an actions input page/action? in struts1 there was the mapping.getInputForward() method, maybe i'm blind but i haven't found an equivalent in struts2.
>
> thanks in advance.
>

Attachment: user_190144.ezm (zipped)
look for Redirect (Action) Result.

/Stephan

> Maybe these resources can help:
>
> http://struts.apache.org/2.x/docs/bootstrap.html
> http://struts.apache.org/2.x/docs/selecting-results.html
> http://struts.apache.org/2.x/docs/result-configuration.html
> http://struts.apache.org/2.x/docs/result-types.html
>
> Nils-H
>
> On Mon, Aug 18, 2008 at 11:31 AM, wanginfo <wanginfo@(protected):
> > how do i return to an actions input page/action? in struts1 there was
> the mapping.getInputForward() method, maybe i'm blind but i haven't found an
> equivalent in struts2.
> >
> > thanks in advance.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)

--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

Attachment: user_190139.ezm (zipped)
Annother middle way would be to use the "plain text result" and no separate class attribute like this

<action name="intro" >
<interceptor-ref name="myAuth"/>
<result type="plaintext">/intro.html</result>
</action>

Advantages:
-no own Action class (ActionSupport is used)
-your static resources don't get processed which should save time
-you can still your Security interceptors to check the Authentication and Authorization of the user

/Stephan

> >> Roger wrote:
> >> > Having followed this group for a while I know that the generally
> >> accepted
> >> > wisdom is that every page should be handled via an Action. However, I
> >> > have an application that is probably going to be 70% static pages
> with
> >> > 30% Strut-able actions to handle form entry etc etc. This means that
> >> I'm
> >> > going to have an awful lot of action classes that do nothing other
> than
> >> > display the next page which feels kludgy. How would people deal with
> >> > this?
> >> >
> >> > Regards
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@(protected)

Attachment: user_190140.ezm (zipped)
> Is there an ETA on when 2.1.3 (or greater) will go GA?

not that i know of (which doesn't say much) but the bugtracker (https://issues.apache.org/struts/secure/Dashboard.jspa) site says it's 87% finisched.

/Stephan
--
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

Attachment: user_190141.ezm (zipped)
Attachments aren't propagated to the mailing list. If you really think a screenshot is the best way to capture textual information you could post it to any of several free internet picture sites.

More information would be... helpful. Things like the configuration of the action that's throwing the exception.

Dave


--- On Mon, 8/18/08, Pranab <chinu.struts@(protected):

> From: Pranab <chinu.struts@(protected)>
> Subject: NullPointer Exception On IE7
> To: user@(protected)
> Cc: ayushverma@(protected)
> Date: Monday, August 18, 2008, 5:24 AM
> Hi Folks,
>
> We are facing NullPointer Exceptions in IE7, though such
> error are not coming in IE6, actually this error is coming
> at our client on IE7 only. We unable to recreate the same at
> our side even in IE7.
>
> Implementation-Version: 1.0
> Specification-Title: Struts Framework
> Specification-Version: 1.0
> Implementation-Title: Struts Framework
> Extension-Name: Struts Framework
> Created-By: Ant 1.4.1
> Internet Explorer: 7.0
> JRE: 1.4.x
> Plumtree Portal: version 4.5 WS1
> Deployment Server: Weblogic 8.1 SP5
>
> Also please find attached is the screen shot of error for
> your reference. We have implemented the Struts based web
> application on Plumtree portal.
>
> If checking log, only one session is showing for each
> nullpointer exceptions nothing else.
>
> Please let me know if you need anymore details on this.
>
> -
> Pranab---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_190147.ezm (zipped)
Thanks Dave, if this violates the mailing list policy then I'm sorry for that.

But the amazing thing is that I'm not getting any sort of error in log with descriptive information. The application is working very fine at our end, also for most of the users only few people are getting NullPointer Exceptions.

Whenever they are trying to search a project, the application searches it in the database and open the result in a new window. And the error is displaying in that window.


Struts-config.xml
=================
Error:
<global-forwards type="org.apache.struts.action.ActionForward">
...
  <forward name="unexpectedError" path="/error/Error.jsp" />
...
</global-forwards>
.
.
.
.
   <action  path="/projectSearch"
       type="com.myapp.projecttracking.search.ProjectSearch"
       name="projectSearchForm"
       input="/main/projectSearch.jsp"
       validate="true"
       scope="session">
     <forward name="success" path="/main/projectSearchResults.jsp"/>
     <forward name="newSearch" path="/setupProjectSearch.do"/>
   </action>
====================

ProjectSearch.java
==================
public class ProjectSearch extends Action {


 static Logger log = Logger.getLogger(ProjectSearch.class);

 public ActionForward execute(
   ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
   throws IOException, ServletException {
   
   
   
   
     HttpSession session = request.getSession();
     GSServices gs = (GSServices) (session.getServletContext().getAttribute(Constants.GSServices));
     
     Properties props = gs.getAdminSettings();
     log.debug("Propos: "+props);
     ProjectSearchForm searchForm = (ProjectSearchForm) form;    
     
     
     session.setAttribute(Constants.SEARCHFORM,searchForm);      

     
     

   String memberID = (String) session.getAttribute("memberID");
/* Temporary Change to run the application --- Tarun Kumar
     String memberID = gs.getGatewaySpecificConfig().getProperty(GSServices.PT_USER_NAME);
     log.debug("User name="+memberID);      

     
     memberID = memberID.substring(memberID.lastIndexOf('\\') + 1);
*/
     //Catchall if some page wants to redisplay search results but form is null
     if (searchForm == null) {
       return mapping.findForward("newSearch");
     }

     searchForm.setMemberID(memberID);

     int pageSize = Constants.DEFAULT_PAGE_SIZE;
     

     
     try {        
         int i=searchForm.getResultsPerPage();
         if (i >= Constants.MIN_PAGE_SIZE || i <= Constants.MAX_PAGE_SIZE) {
           pageSize = i;
       }
     } catch (NumberFormatException e) {
       pageSize = Constants.DEFAULT_PAGE_SIZE;
     }

     searchForm.setPageSize(pageSize);
     
     String pageRequested = request.getParameter(Constants.RK_PAGE_NUMBER);
     if (pageRequested != null) {
       try {
         searchForm.setPageRequested(Integer.parseInt(pageRequested));
       } catch(NumberFormatException e) {
         //page number specified in the HTTP request was not a number, ignore
       }
     } else {
       searchForm.setPageRequested(1);
     }
     
     String sortByField = request.getParameter(Constants.RK_SORT_BY_FIELD);
     if (sortByField != null) {
       try {
         searchForm.setSortByField(Integer.parseInt(sortByField));
       } catch(NumberFormatException e) {
         //page number specified in the HTTP request was not a number, ignore
       }
     }

     ActionErrors errors = new ActionErrors();
     
     
     
     try {

       SearchCommand search = new SearchCommand();
   
       //ProjectSearchForm implements ISearchCriteria, so we can
       //safely pass it to the business layer without tying the
       //business layer to Struts or the Servlet API
       log.debug("Before searching ");
       
       

       log.debug("User's Adgroups are : "+(ArrayList)session.getAttribute(Constants.SK_ADGROUPS));
       ArrayList arradgroups= (ArrayList)session.getAttribute(Constants.SK_ADGROUPS);
       String adgroup;
       boolean isGPCMember= false;
       boolean isLPCMember= false;
       if(arradgroups!=null){
         Iterator iter = arradgroups.iterator();
         while (iter.hasNext()) {
           adgroup= (String) iter.next();
           if(Constants.ROLE_GPC.equals(adgroup)){
             isGPCMember=true;
           }
           if(Constants.ROLE_LPC.equals(adgroup)){
             isLPCMember=true;
           }
         }
       }
       

       SearchResults results = search.execute(props, searchForm, false, isGPCMember, false, isLPCMember);
       log.debug(".............After search.execute...........results.toString()===="+results.toString());
       request.setAttribute(Constants.RK_SEARCH_RESULTS, results);

       session.setAttribute(Constants.ISEDITABLE,Boolean.FALSE);
       
       return mapping.findForward("success");

     } catch (NullPointerException e) {

       log.error(e);

       //Another action was likely trying to redisplay search results, but the
       //search criteria form is not in a valid state
       return mapping.findForward("newSearch");

     } catch (Exception e) {
       

          try

          {

           SchedulerVO vo = new SchedulerVO();

           //Properties props = ((GSServices) session.getServletContext().getAttribute(Constants.GSServices)).getAdminSettings();

           TransactionContext tc = new TransactionContext(props, false);          
           vo.setDetailMessage(e.toString());
           vo.setSpecificMessage("Error in getting search results");
           vo.setFormData(searchForm.toString());
           Util.errorTrack(tc, vo);

          }

          catch (Exception ex)

          {

           log.error("Exception in inserting Error in DB from ProjectSearch.");

          }

   
       
       log.error(e.getMessage());
       errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.message", e.getMessage()));
       saveErrors(request, errors);
       return mapping.findForward("unexpectedError");
     }
         
   }

}
==================

Error.jsp, timeout.jsp, and NotAuthorized.jsp are three error pages in my application.

Let me know if I'm wrong at any point.

- Pranab


On Mon, 18 Aug 2008 Dave Newton wrote :
>Attachments aren't propagated to the mailing list. If you really think a screenshot is the best way to capture textual information you could post it to any of several free internet picture sites.
>
>More information would be... helpful. Things like the configuration of the action that's throwing the exception.
>
>Dave
>
>
>--- On Mon, 8/18/08, Pranab <chinu.struts@(protected):
>
> > From: Pranab <chinu.struts@(protected)>
> > Subject: NullPointer Exception On IE7
> > To: user@(protected)
> > Cc: ayushverma@(protected)
> > Date: Monday, August 18, 2008, 5:24 AM
> > Hi Folks,
> >
> > We are facing NullPointer Exceptions in IE7, though such
> > error are not coming in IE6, actually this error is coming
> > at our client on IE7 only. We unable to recreate the same at
> > our side even in IE7.
> >
> > Implementation-Version: 1.0
> > Specification-Title: Struts Framework
> > Specification-Version: 1.0
> > Implementation-Title: Struts Framework
> > Extension-Name: Struts Framework
> > Created-By: Ant 1.4.1
> > Internet Explorer: 7.0
> > JRE: 1.4.x
> > Plumtree Portal: version 4.5 WS1
> > Deployment Server: Weblogic 8.1 SP5
> >
> > Also please find attached is the screen shot of error for
> > your reference. We have implemented the Struts based web
> > application on Plumtree portal.
> >
> > If checking log, only one session is showing for each
> > nullpointer exceptions nothing else.
> >
> > Please let me know if you need anymore details on this.
> >
> > -
> > Pranab---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail:
> > user-help@(protected)
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@(protected)
>For additional commands, e-mail: user-help@(protected)
>

Attachment: user_190142.ezm (zipped)
--- On Mon, 8/18/08, Muralidhar Y wrote:
> Hi , when I typed the code in my jsp like the following
>
> <s:checkbox name="searchedPoP%{#stat.index}"
>         value="one" />
>
> In the html file the following code is being shown. By
> default the attribute value is being true. Instead I want
> to give some other value. Kindly help.
>
> <input type="checkbox" name="searchedPoP0" value="true"
>     id="addPalettePoP_searchedPoP0"/>

Do you have an action property named "one"? Value attributes are objects, not strings:

http://struts.apache.org/2.x/docs/tag-syntax.html

Dave


Attachment: user_190146.ezm (zipped)
Thank you.

Warm regards,
Muralidhar Y
muralidhary@(protected)

US Main: 877 KENSIUM (536.7486)
India Main: +91 9949495511
India Fax:  +91 9949495522
Kensium
200 S Wacker Dr, Suite 3100
Chicago, IL 60606


Confidentiality Note:
-----------------------------
The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.
If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.

________________________________



-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Monday, August 18, 2008 4:08 PM
To: Struts Users Mailing List
Subject: Re: problem with checkbox

--- On Mon, 8/18/08, Muralidhar Y wrote:
> Hi , when I typed the code in my jsp like the following
>
> <s:checkbox name="searchedPoP%{#stat.index}"
>         value="one" />
>
> In the html file the following code is being shown. By
> default the attribute value is being true. Instead I want
> to give some other value. Kindly help.
>
> <input type="checkbox" name="searchedPoP0" value="true"
>     id="addPalettePoP_searchedPoP0"/>

Do you have an action property named "one"? Value attributes are objects,
not strings:

http://struts.apache.org/2.x/docs/tag-syntax.html

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


Attachment: user_190143.ezm (zipped)
Thank you all for your answers!

"#session.skillsFound" worked (Not "#skillsFound" but that doesn't
matter. One way to do it is enough.)

Now I have a new problem, but I'll take that in another mail.

/Ylva

On Sun, Aug 17, 2008 at 4:48 PM, "Stephan Schröder" <simon.void@(protected):
>> --- On Sun, 8/17/08, "Stephan Schröder" wrote:
>> > i'm pretty sure <s:if test="#skillsFound != null"> works too.
>>
>> AFAIK the "#" syntax will work only if the variable was defined as a named
>> stack context variable via something like <s:set...> or as the value of a
>> "var" ("id" in S2.0) attribute and so on.
>>
>> Dave
>
> good to know.
>
> Thanks,
> Stephan
> --
> GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_190145.ezm (zipped)
MyAshok wrote:
> I do have the same issue. on click of submit, the loadingtext is displaying
> but the result in a new page as i am redirect to a action.
>
> Any solutions? please asap.
>
> <action name="activateSubscriber" class="subscriberAction"
>      method="activateSubscriber">
>      <result name="success" type="redirect-action">viewPartners</result>
>    </action>
> Waiting for reply......
>
>  

If it's performing a full-page redirect, then your form did a plain old
post/get to the action, not ajax.
You will need to isolate why the request wasn't sent via XHR. That
means it's a client-side problem, not a struts.xml problem.

As a guess, without any context, if you've only tested in IE so far,
turn off the loadingText message.



Attachment: user_190148.ezm (zipped)
Hi friends I am facing the following error. I hope the execute method is not
working. This is working fine few minutes ago. Suddenly started this error.



No configuration found for the specified action: 'executePoPSearch.action'
in namespace: '/p'. Form action defaulting to 'action' attribute's literal
value.



My config in xml is



<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN"

  "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

   <package name="PoP-SearchConfig" namespace="/p" extends="PoP-default">


       <default-interceptor-ref name="defaultStack" />





       <action name="executePoPSearch"
class="org.paradigmpop.mypopproject.search.actions.ExecutePoPSearchAction">

           <result name="success">/p/pop_search_results.jsp</result>

           <result name="input">/p/pop_search_results.jsp</result>

           <result name="error">/p/pop_search.jsp</result>

       </action>

</package>

</struts>



Warm regards,

Muralidhar Y

muralidhary@(protected)



US Main: 877 KENSIUM (536.7486)
India Main: +91 9949495511

India Fax:  +91 9949495522

Kensium

200 S Wacker Dr, Suite 3100

Chicago, IL 60606





Confidentiality Note:
-----------------------------
The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.
If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.



_____



©2008 gg3721.com - Jax Systems, LLC, U.S.A.