Solved

how can i change struts source??

Posted on 2004-08-18
4
307 Views
Last Modified: 2010-04-01
hi,experts,now i want change the process method in jakarta-struts-1.1/lib/struts.jar/org/apache/struts/action/ActionServlet.class

now i hava down the jakarta-struts-1.1 source and in ActionServlet.java,i add two lines,like this:
    /**
     * Perform the standard request processing for this request, and create
     * the corresponding response.
     *
     * @param request The servlet request we are processing
     * @param response The servlet response we are creating
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet exception is thrown
     */
    protected void process(HttpServletRequest request,
                           HttpServletResponse response)
        throws IOException, ServletException {
          request.setCharacterEncoding("gb2312");  //i added it
         response.setContentType("text/html;charset=gb2312"); //i added it

        RequestUtils.selectModule(request, getServletContext());
        getRequestProcessor(getModuleConfig(request)).process
            (request, response);

    }

but when i add it ,i can not compile it, can any experts help me compile it and send me struts.jar, thanks very much!

mymail:jbasttdi@hotmail.com

thanks very much!
0
Comment
Question by:hgbdelphi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 100 total points
ID: 11828600
1) write your own class which extends ActionServlet
2) just override the process method (like you have done)
3) in WEB-INF/web.xml, change:

  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

to

  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>your.package.MyActionServlet</servlet-class>

That should then work...
0
 

Author Comment

by:hgbdelphi
ID: 11828692
hi, TimYates

thanks for your help,but when i write my self ActionServlet,i can not compile it,
javac my.package.MyActionServlet  can not comile,how can i do it?
0
 

Author Comment

by:hgbdelphi
ID: 11828890
hi,thanks very much,when i add some org.apache lib ,it can compile,thanks ,and my code can run well,thanks very much!

 Best Regard For you!
0
 
LVL 35

Expert Comment

by:TimYates
ID: 11828908
Yay!  Glad I could help :-)

Good luck with it all!!

Tim
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Coldfusion 10 - JSP File Not Found - 404 Error 5 109
servlet concurrency 13 117
how to hide hide popup page refresh second time? 10 162
null output 3 42
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question