Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how can i change struts source??

Posted on 2004-08-18
4
Medium Priority
?
314 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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