Struts2 changes the Portlet windowstate

Source: Internet
Author: User
Import Java. Io. ioexception;
Import Java. util. Map;

Import Javax. Portlet. actionrequest;
Import Javax. Portlet. actionresponse;
Import Javax. Portlet. portletexception;
Import Javax. Portlet. portletrequest;
Import Javax. Portlet. portletresponse;
Import Javax. Portlet. renderrequest;
Import Javax. Portlet. renderresponse;
Import Javax. Portlet. windowstate;
Import Javax. servlet. http. httpservletrequest;
Import Javax. servlet. http. httpservletresponse;

ImportOrg. Apache. struts2.portlet. Dispatcher. jsr168dispatcher;
ImportOrg. Apache. struts2.portlet. servlet. portletservletrequest;
ImportOrg. Apache. struts2.portlet. servlet. portletservletresponse;

Public   Class Jsr168comsysdispatcher Extends Jsr168dispatcher {
Private Windowstate = Null ;
Public   Void Processaction (actionrequest request, actionresponse response)
Throws Portletexception, ioexception { // Maximize processing of Portlet
Super . Processaction (request, response );
If (Windowstate ! = Null ){
Response. setwindowstate (windowstate );
Windowstate = Null ;
Public   Void Render (renderrequest request, renderresponse response)
Throws Portletexception, ioexception {
Super . Render (request, response );

Public   Void Serviceaction (portletrequest request, portletresponse response, map < String, Object > Requestmap, map < String, string [] > Parametermap,
Map < String, Object > Sessionmap, map < String, Object > Applicationmap, string portletnamespace,
Integer phase) Throws Portletexception {
Super . Serviceaction (request, response, applicationmap, parametermap, applicationmap, applicationmap, portletnamespace, phase );
Httpservletrequest servletrequest =   New Portletservletrequest (request, getportletcontext ());
Httpservletresponse servletresponse =   New Portletservletresponse (response );
If (Servletrequest. getattribute ( " Windowstate. comsysstatus " ) ! = Null ){
If (Windowstate. maximized). Equals (servletrequest. getattribute ( " Windowstate. comsysstatus " ))){
Windowstate = Windowstate. maximized;
} Else   If (Windowstate. Minimized). Equals (servletrequest. getattribute ( " Windowstate. comsysstatus " ))){
Windowstate = Windowstate. minimized;
} Else   If (Windowstate. Normal). Equals (servletrequest. getattribute ( " Windowstate. comsysstatus " ))){
Windowstate = Windowstate. normal;
} Else {
Windowstate = Null ;
} Else {
Windowstate = Null ;< BR >}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.