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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:41:01+00:00 2026-06-15T10:41:01+00:00

I have a payment form. When user submit the form the payment process runs

  • 0

I have a payment form. When user submit the form the payment process runs successfully, but clicking the back button brings user to same form. I want to expire the form after successful submission, to prevent user from multiple payment (in case user goes back and submit form).
Following Prevent user from going back tutorial, I added the filter but it’s not working for me. What am I doing wrong? Here is what I added for filtering.

<filter>
    <filter-name>paymentFilter</filter-name>
    <filter-class>path to PaymentFilter class</filter-class>
</filter>
<filter-mapping>
    <filter-name>paymentFilter</filter-name>
    <url-pattern>/order/*/payment</url-pattern>
</filter-mapping>

and my filter class is

public class PaymentFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        // TODO Auto-generated method stub          
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain chain) throws IOException, ServletException {

        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
        httpServletResponse.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
        httpServletResponse.setHeader("Pragma", "no-cache"); // HTTP 1.0.
        httpServletResponse.setDateHeader("Expires", 0); // Proxies.
        System.out.println("In filter");            
    }

    @Override
    public void destroy() {
        // TODO Auto-generated method stub          
    }

}

I have added a System.out.println("In filter") but I can’t see its output (“In filter”) on console after running the page.

When I use the URL pattern as /* the System.out prints on console,

<url-pattern>/*</url-pattern> (it works as expected)

but when I change the URL pattern to /order/*/payment (* is order id what changes for each order). then System.out does not print anything on console.

<url-pattern>/order/*/payment</url-pattern> (it doesn't work)

I am using spring mvc, apache, tomcat7.0

  • 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-06-15T10:41:03+00:00Added an answer on June 15, 2026 at 10:41 am

    What gave me the solution to my problem is that i “can not” user regular expression in my url-patter for filter mapping. * can only be use as suffix or prefix.

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

Sidebar

Related Questions

I have pay now form on my page and after user finishes his payment
I have a payment page on my website: domain.com/user/payment/product_name and I want to be
I have a signup form posting to my customers_controller, but now they want the
i have two user type Retailer and Private but i want to open different
I have a form where I want the user to choose 2 different way
I have OnClientClick=return confirm('Make Payment?'); tied to an asp:Button. It works fine, however, prior
I have a Python CGI handling a payment transaction. When the user submits the
I have a user signup form, and I need to insert a function to
I have a django form that allows a user to select multiple options: CARDS
A lot of this form has specific attributes for my payment provider, but I

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.