package com.bankaudit.security;

import java.util.HashMap;

import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestWrapper;

public class ReqWrapper extends ServletRequestWrapper {
	 
    private HashMap params = new HashMap();
 
    public ReqWrapper(ServletRequest request) {
        super(request);
    }
 
    public String getParameter(String name) {
        // if we added one, return that one
        if ( params.get( name ) != null ) {
            return (String) params.get( name );
        }
        // otherwise return what in the original request
        ServletRequest req = (ServletRequest) super.getRequest();
        return req.getParameter( name );
    }
 
    public void addParameter( String name, String value ) {
        params.put( name, value );
    }
}