Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 259975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:18:33+00:00 2026-05-11T22:18:33+00:00

I am developing a JSR-286 compliant portlet based on struts 1.2.9 (for historical reasons

  • 0

I am developing a JSR-286 compliant portlet based on struts 1.2.9 (for historical reasons we want to reuse a lot existing code) using the struts portlet bridge. I want some links to change the WindowState, but the FormTag and LinkTag provided by the portal bridge don’t have an easy way to set the WindowState. I’m happy to extend these two tags, but am unsure how to proceed, how can I determine what request parameters need adding in a portal agnostic way?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:18:33+00:00Added an answer on May 11, 2026 at 10:18 pm

    Oh well, might as well answer my own question 🙂

    I had to create my own versions of TagsSupport, FormTag and LinkTag based on (not extending) the struts bridge code.

    I modified the methods TagsSupport.getUrl() and TagsSupport.getFormTagRenderFormStartElement() to accept a WindowState parameter and use it when creating render and action URLs.

    public static String getURL(PageContext pageContext, String url, PortletURLTypes.URLType type, WindowState ws)
    ...
        if ( type.equals(PortletURLTypes.URLType.ACTION) )
        {
          final PortletURL portletURL = StrutsPortletURL.createActionURL(pageContext.getRequest(), url);
          if (ws!=null) {
            try {
              portletURL.setWindowState(ws);
            }
            catch (WindowStateException e) {
              e.printStackTrace();
            }
          }
          return portletURL.toString();
        }
        else if ( type.equals(PortletURLTypes.URLType.RENDER) )
        {
          final PortletURL portletURL = StrutsPortletURL.createRenderURL(pageContext.getRequest(), url);
          if (ws!=null) {
            try {
              portletURL.setWindowState(ws);
            }
            catch (WindowStateException e) {
              e.printStackTrace();
            }
          }
          return portletURL.toString();
        }
    ...
    

    and

    public static String getFormTagRenderFormStartElement(PageContext pageContext, String formStartElement, WindowState ws)
    {
        if ( PortletServlet.isPortletRequest(pageContext.getRequest()))
        {
            int actionURLStart = formStartElement.indexOf("action=") + 8;
            int actionURLEnd = formStartElement.indexOf('"', actionURLStart);
            String actionURL = formStartElement.substring(actionURLStart,
                    actionURLEnd);
          final PortletURL portletURL = StrutsPortletURL.createActionURL(pageContext.getRequest(),
                                                                        actionURL);
          if (ws!=null) {
            try {
              portletURL.setWindowState(ws);
            }
            catch (WindowStateException e) {
              e.printStackTrace();
            }
          }
          formStartElement = formStartElement.substring(0, actionURLStart)
                    + portletURL.toString()
                    + formStartElement.substring(actionURLEnd);
        }
        return formStartElement;
    }
    

    I then changed FormTag and LinkTag to accept a WindowState attribute and pass it to the methods in TagsSupport.

    private String windowState;
    
    public String getWindowState() {
        return windowState;
    }
    
    public void setWindowState(String windowState) {
        this.windowState = windowState;
    }
    

    and

    url = TagsSupport.getURL(pageContext, url, urlType, new WindowState(getWindowState()));
    

    Obviously then needed a tld to reference my modified tags.

    This has been supplied as a patch PB-91 (also incorporating a fix for changing portlet mode) to the struts bridge project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started developing a portlet based application using WebSphere Portal and now I am
While developing an application using gwt in ecliplse crashed. Now the server is running
For developing an devices monitor system, I am using a InetAdress isReachable method to
Developing a desktop application based on Java + Swing I faced the problem of
Developing a Struts 2 app I run in a following problem. I need to
Developing an application for Android, i want to record data that will be usefull
Developing a simple game for the iPhone, what gives a better performance? Using a
Developing a chrome extension using javascript is one of my university projects. I don't
Developing using MVC-3, Razor, C# Been searching around and cannot find advice I'm looking
Developing mobile apps is a challenging job. Customers want to be present not only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.