Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 18 Aug 2008 14:28:26 -0000 Issue 8199

user-digest-help

2008-08-18


Author LoginPost Reply

user Digest 18 Aug 2008 14:28:26 -0000 Issue 8199

Topics (messages 190149 through 190162):

Re: NullPointer Exception On IE7
 190149 by: Dave Newton
 190153 by: Jeromy Evans
 190154 by: Martin Gainty

Re: simple ajax form - returns value to a new page (not to a DIV)
 190150 by: MyAshok
 190151 by: Dave Newton
 190155 by: Jeromy Evans

Re: Struts loses action configuration
 190152 by: tjstavenger

Re: [S2] 2.1.3GA?
 190156 by: Musachy Barroso

Static Content Loading in Struts 2
 190157 by: Ramez Hassan
 190161 by: Musachy Barroso

Problem with no configaration found
 190158 by: Muralidhar Y
 190160 by: Dave Newton

Re: Struts2 Portlet - pre/post render, pre/post action hooks?
 190159 by: ossieguy
 190162 by: Nils-Helge Garli Hegvik

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_190149.ezm (zipped)
So... we still have no idea what exception is being thrown.

That makes it really hard to even begin.

Dave


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

> From: Pranab <chinu.struts@(protected)>
> Subject: Re: Re: NullPointer Exception On IE7
> To: "Struts Users Mailing List" <user@(protected)>
> Cc: "Dave Newton" <newton.dave@(protected)>
> Date: Monday, August 18, 2008, 7:59 AM
> 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_190153.ezm (zipped)
Dave Newton wrote:
> So... we still have no idea what exception is being thrown.
>
> That makes it really hard to even begin.
>
> Dave
>
>
>  


I think MemberId is null:

memberID = memberID.substring(memberID.lastIndexOf('\\') + 1);



Or pageRequested is null

searchForm.setPageRequested(Integer.parseInt(pageRequested));



Or sortByField is null:

searchForm.setSortByField(Integer.parseInt(sortByField));


Just a hunch.


Attachment: user_190154.ezm (zipped)

did you verify your jsp compiler compiles the page?Please display/attach any/all pages causing the error and we'll reproduce here
error.jsp
projectSearch.jsp
projectSearchResults.jsp

also please highlight any version and IE specific ActiveX controlsMartin ______________________________________________ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > Date: Mon, 18 Aug 2008 05:04:52 -0700> From: newton.dave@(protected)>
_________________________________________________________________
See what people are saying about Windows Live. Check out featured posts.
http://www.windowslive.com/connect?ocid=TXT_TAGLM_WL_connect2_082008

Attachment: user_190150.ezm (zipped)


Thanks Evans,

In IE, instead of loading text it shows [object error]. But it redirects to
a new page.

In Firefox, neither showing loading text nor object error. It redirects to a
new page.


<s:submit theme="ajax" value="Activate" id="activate"
showLoadingText="false" targets="targetid"
onclick="javascript:activatePartnerSubscriber();" />

script
------

 function activatePartnerSubscriber() {

   subCount =  document.getElementById('subCount').value;
   
   var count = selectedCheckBoxCount();
   if (count >= 1) {
     
     document.getElementById('SubscriberForm').action
='/myproj/activate.action';

     document.getElementById('SubscriberForm').submit();
   } else {
     alert("Please select atleast one Subscriber");
   }
 }

I am unable to find where the ajax request is missing. Please Give some
ideas to proceed.

with hope,
Ashok




Jeromy Evans - Blue Sky Minds wrote:
>
> 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.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_190151.ezm (zipped)
I'd be immediately suspicious of your manual form submission; as a guess I'd say that bypasses the normal form submission process, making it a non-XHR request.

Off-the-cuff guess, though.

Dave


--- On Mon, 8/18/08, MyAshok <takumar.eng@(protected):

> From: MyAshok <takumar.eng@(protected)>
> Subject: Re: struts2: simple ajax form - returns value to a new page (not to a DIV)
> To: user@(protected)
> Date: Monday, August 18, 2008, 8:08 AM
> Thanks Evans,
>
> In IE, instead of loading text it shows [object error]. But
> it redirects to
> a new page.
>
> In Firefox, neither showing loading text nor object error.
> It redirects to a
> new page.
>
>
> <s:submit theme="ajax"
> value="Activate" id="activate"
> showLoadingText="false"
> targets="targetid"
> onclick="javascript:activatePartnerSubscriber();"
> />
>
> script
> ------
>
>  function activatePartnerSubscriber() {
>
>    subCount =
>  document.getElementById('subCount').value;
>    
>    var count = selectedCheckBoxCount();
>    if (count >= 1) {
>      
>      document.getElementById('SubscriberForm').action
> ='/myproj/activate.action';
>
>      document.getElementById('SubscriberForm').submit();
>    } else {
>      alert("Please select atleast one Subscriber");
>    }
>  }
>
> I am unable to find where the ajax request is missing.
> Please Give some
> ideas to proceed.
>
> with hope,
> Ashok
>
>
>
>
> Jeromy Evans - Blue Sky Minds wrote:
> >
> > 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.
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> > For additional commands, e-mail:
> user-help@(protected)
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/struts2%3A-simple-ajax-form---returns-value-to-a-new-page-%28not-to-a-DIV%29-tp15562626p19030271.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_190155.ezm (zipped)
Dave Newton wrote:
> I'd be immediately suspicious of your manual form submission; as a guess I'd say that bypasses the normal form submission process, making it a non-XHR request.
>
> Off-the-cuff guess, though.
>
> Dave
>  

Absolutely positive that's it.

This line:

document.getElementById('SubscriberForm').submit();

performs a plain only non-ajax request.

MyAshok, see the dojo ajax recipes for how to cause an ajax submit using
the publish/subscribe event model.



Attachment: user_190152.ezm (zipped)

My application makes connections to our database through data sources
configured in WebLogic, and I'm not seeing any logs from WebLogic saying
that it has lost the connection... But I'll certainly keep an eye out for
it.

As for #1, which connection are you referring to. The database or something
else?

Thanks for the help,
Tim
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_190156.ezm (zipped)
I don't think any of the remaining bugs are big deal, and we should go
ahead with the build, but as the fine print reads, it depends on the
time of the volunteers, and we don't have many of those for
building/release management.

On 8/18/08, "Stephan Schröder" <simon.void@(protected):
>> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment: user_190157.ezm (zipped)
Hello Folks,



I am trying to implement a theme enabled web application and the
architecture is developed to upload themes to the application using jar or
zip files with a certain directory structure. The problem is I don't know
how to enable such a feature or how to extend struts control classes to
perform such a thing.



We are depending mainly on JSP 2.0 for the view and we need to reference all
images and css styles and layout from Jar files.



Any Idea will be appreciated.



Regards,

Ramez Hassan


Attachment: user_190161.ezm (zipped)
If you are building from trunk,

"To include static resources in your plugins add them under "/static"
in your jar. And include them in your page using "/static" as the
path, like in the following example:

Assuming /static/main.css is inside a plugin jar, to add it to the page:

<@(protected)" />
<link rel="stylesheet" type="text/css" href="%{#css}" />"

If your are using 2.0, there is a "hack" for it, you can put your
resources inside the jars under the dir:

org/apache/struts2/static/main.css

and then use "/struts" as the path:

<@(protected)" />
<link rel="stylesheet" type="text/css" href="%{#css}" />"

musachy


On Mon, Aug 18, 2008 at 10:00 AM, Ramez Hassan
<ramez.hassan@(protected):
> Hello Folks,
>
>
>
> I am trying to implement a theme enabled web application and the
> architecture is developed to upload themes to the application using jar or
> zip files with a certain directory structure. The problem is I don't know
> how to enable such a feature or how to extend struts control classes to
> perform such a thing.
>
>
>
> We are depending mainly on JSP 2.0 for the view and we need to reference all
> images and css styles and layout from Jar files.
>
>
>
> Any Idea will be appreciated.
>
>
>
> Regards,
>
> Ramez Hassan
>
>



--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment: user_190158.ezm (zipped)
Hi friends I am getting the following error. I think it is a known issue.
Kindly help me in this.



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



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.



_____




Attachment: user_190160.ezm (zipped)
This is a duplication of your previous post, no?

As it seems there's a form involved perhaps posting the JSP would be a good idea.


--- On Mon, 8/18/08, Muralidhar Y <muralidhary@(protected):

> From: Muralidhar Y <muralidhary@(protected)>
> Subject: Problem with no configaration found
> To: "'Struts Users Mailing List'" <user@(protected)>
> Date: Monday, August 18, 2008, 9:23 AM
> Hi friends I am getting the following error. I think it is a
> known issue.
> Kindly help me in this.
>
>
>
> No configuration found for the specified action:
> 'executePoPSearch.action'
> in namespace: '/p'. Form action defaulting to
> 'action' attribute's literal
> value.
>
>
>
> 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.
>
>
>
>  _____

Attachment: user_190159.ezm (zipped)

Torsten, did you ever solve this? We're having the same problem.

I think it's worth mentioning that the "action phase" and "render phase" are
distinct concepts that come directly from the Portlet API, with or without
Struts.

So Torsten's original confusion is ours as well - Struts2 portlet support
doesn't seem to separate the two, but rather lump them together as a single
"view phase". Obviously this is a big problem performance wise, e.g. you
really want to make your heavy service-tier invocation at action time, and
*not* each time a user resizes a portlet for instance - that would just be a
call to render.

The PortletActionContext does make mention of the RENDER_PHASE, we're
looking now at how to use that, probably in an if-then expression within the
single execute() method.

The generic interceptor concept, while somewhat analogous to the action
phase/render phase, doesn't really solve the problem that struts lacks a
natural exposure of the underlying portlet API.

So I can't resist quoting the Spring Portlet MVC docs: "Most other portlet
MVC frameworks attempt to completely hide the two phases from the developer
and make it look as much like traditional servlet development as possible -
we think this approach removes one of the main benefits of using portlets."

But we'd really rather use Struts2!

Cheers,

Ossie



Nils-Helge Garli wrote:
>
> I think you should be able to write an interceptor to do this. Take a
> look at [1] and [2] for some information about how it works and how to
> write custom interceptors. All the information you need to access
> should be available in the invocation context. You should also take a
> look at the PortletActionContext class.
>
> Nils-H
>
> [1] - http://struts.apache.org/2.x/docs/interceptors.html
> [2] - http://struts.apache.org/2.x/docs/writing-interceptors.html
>
>
>> I want to intercept the dispatching of the "Render" and "Action" phase of
>> the
>> portlet, to inject SecurityContext of Spring Security, like its done with
>> spring portlet mvc framework (there are HandlerAdapters which do that).
>>
>> Is this possible using interceptors?
>> How do i know if its a doAction or doRender request from interceptors
>> point of
>> view ? And how do i know if its "before" or "after"?
>> Afaik see interceptor does not know this as ActionProxy Chain does call
>> them
>> which is invoked from Jsr168Dispatcher, am i right?
>> If this is the case, i don't know "where" i am and can't do this with
>> interceptors.
>>
>> If its not possible, what would be the "best" way to do so?
>>
>> Torsten
>>
>> --
>> Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
>> Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html
>>
>> Really, I'm not out to destroy Microsoft. That will just be a
>> completely unintentional side effect."
>>     -- Linus Torvalds
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_190162.ezm (zipped)
> I think it's worth mentioning that the "action phase" and "render phase" are
> distinct concepts that come directly from the Portlet API, with or without
> Struts.
>
> So Torsten's original confusion is ours as well - Struts2 portlet support
> doesn't seem to separate the two, but rather lump them together as a single
> "view phase". Obviously this is a big problem performance wise, e.g. you
> really want to make your heavy service-tier invocation at action time, and
> *not* each time a user resizes a portlet for instance - that would just be a
> call to render.

Luckily, that is not the case :) Maybe not crystal clear, but it is
mentioned in the portlet plugin documentation [1]. To summarize, when
you do a state change transition (e.g. posting a form, or clicking a
link with the "action" url type), if you have set up the results in a
post-redirect-get fashion, the action processing the form will do so
in the action phase, and the view result will be rendered in the
render phase. So you can take full advantage of the portlet API
features such as caching the view.

>
> The PortletActionContext does make mention of the RENDER_PHASE, we're
> looking now at how to use that, probably in an if-then expression within the
> single execute() method.
>
> The generic interceptor concept, while somewhat analogous to the action
> phase/render phase, doesn't really solve the problem that struts lacks a
> natural exposure of the underlying portlet API.

Using the PortletActionContext you can access the full portlet API.
There are also pre configured interceptors that can inject the portlet
objects into your action (take a look at the portlet tutorial [2]).
Other than that, if there are specific features that you are looking
for, please let me know so we can improve the plugin.

>
> So I can't resist quoting the Spring Portlet MVC docs: "Most other portlet
> MVC frameworks attempt to completely hide the two phases from the developer
> and make it look as much like traditional servlet development as possible -
> we think this approach removes one of the main benefits of using portlets."
>

I like to think that the Struts 2 Portlet Plugin does both: It hides
it by "translating" it to regular Struts 2 and web application
concepts, but it also allow you to access and do whatever with the
portlet API that you wish. That way, both developers who want to
quickly convert their existing web app, and developers who create the
portlets from scratch can do so in a productive way. As a matter of
fact, right from the beginning the portlet plugin was created with the
second scenario in mind. I totally agree that you should be fully
aware of the underlying portlet framework to make the best use of the
plugin.

> But we'd really rather use Struts2!

I totally agree ;)

Nils-H

[1] - http://struts.apache.org/2.x/docs/portlet-plugin.html
[2] - http://struts.apache.org/2.x/docs/struts-2-portlet-tutorial.html
©2008 gg3721.com - Jax Systems, LLC, U.S.A.