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 7646367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:11:23+00:00 2026-05-31T10:11:23+00:00

We are currently using the struts2-jquery plugin in our web-application. The plugin works great

  • 0

We are currently using the struts2-jquery plugin in our web-application. The plugin works great but I have some questions about the internal workings of a struts2 plugin.

We added the plugin to the classpath and can use the tags defined in the taglib. When I look in the source code of the generated page I can see that the recourse are correctly included:

<script type="text/javascript" src="/struts/js/base/jquery-1.x.x.min.js"></script>
<script type="text/javascript" src="/struts/js/base/jquery-ui.min.js"></script>
...

The first question is: how does our web-application know that /struts/ points to the jquery plugin. We did not define anything for that.
The seems to come from the DefaultStaticContentLoader class. There is a method like this:

public boolean canHandle(String resourcePath) {
    return serveStatic && (resourcePath.startsWith("/struts/") || resourcePath.startsWith("/static/"));
}

The second question is that when we call an url like /struts/ or /struts/themes/ the application downloads a file from the plugin as an octet stream (The final result seems to be a zip files containing the css, js and image files). Why is it doing that and is there a way to prevent that.

The second question is more important than the first.

Thanks, Tom.

EDIT: Question one was answered.

  • 1 1 Answer
  • 0 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-31T10:11:25+00:00Added an answer on May 31, 2026 at 10:11 am

    Well Plugin is was provided by the S2 to extends its functionality and change the way S2 work in certain use-case.
    Struts 2 plugins contain classes and configuration that extend, replace, or add to existing Struts framework functionality.Plugin should contains struts-plugin.xml file to tell S2 which is the entry point for the plugin.

    So when S2 start-up, it loads the configuration in a specific manner and sequence.

    1. struts-default.xml
    2. struts-plugin.xml
    3. struts.xml

    So struts-plugin.xml being part of the plugin (jar) will be loaded by the S2 and will register with itself its presence.

    for more details refer to the official documents

    • plugins

    A typical entry in struts-plugin.xml file for JQuery plugin is

    <struts>
        <bean type="org.apache.struts2.views.TagLibrary" name="sj" class="com.jgeppert.struts2.jquery.views.JqueryTagLibrary" />
    </struts>
    

    Which tells S2 that JqueryTagLibrary is the entry point for plugin.The one mentioned by you about loading static content is default S2 handling mechanism until we do no provide any standard mechanism.

    Struts provides a default implementation of StaticContentLoader which is org.apache.struts2.dispatcher.DefaultStaticContentLoader. This loader will handle urls that start with “/static/“.
    For details how the static content being served by S2 from plugin and from it score jars refer to the doc

    • S2 static-content loading
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
I'm currently developing a web application using Struts2 framework. This application requires to dynamically
Currently using Google Analytics as a supplement to our paid tracking software, but neither
I'm currently using the awesome attachment-fu plugin for a Rails app, but as a
I'm using struts2-jquery grid. gridmodel in my action class is getting updated correctly. But,
I am creating a web application on tomcat in framework struts2. I am using
Currently we have developed application using Java 6 based on windows 32bit(Dual core &
I'm currently working with JQuery plugin for struts2. I would like to know how
We have a web application which uses Struts 2, Spring and Hibernate. Currently a
I have web application developed using JSP and struts. I am just looking out

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.