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

  • Home
  • SEARCH
  • 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 7837349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:36:19+00:00 2026-06-02T14:36:19+00:00

I am using Websphere with j_security_check and I have a working login filter with

  • 0

I am using Websphere with j_security_check and I have a working login filter with CONFIDENTIAL and SSL settings. Due to some complex requirements, I need to process the j_username variable before performing j_security_check.

From one of the answers found here, it was said that this pre-login processing cannot be done. However, I noted that the previous asker was using Tomcat, while I am using Websphere. I found that there is a solution for my problem over here but it seems that everytime I try to login, I receive a “The website cannot display the page. The website has a programming error.”

I tried troubleshooting by checking if the syntax was correct. Found some inconsistencies like and corrected them as best I could. However, I still keep getting the same error.

Could someone throw me in the right direction? I can provide further info but they are mostly similar to the second link. The only protected folder is in \protected\ and the .java servlet is located in \WEB-INF\classes.

Thank you.

  • 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-02T14:36:21+00:00Added an answer on June 2, 2026 at 2:36 pm

    In case anyone is interested, the results are here:

    For \WEB-INF\web.xml

    <filter id="Filter_1">
        <filter-name>LoginFilter</filter-name>
        <filter-class>com.myloginfilter.MyLoginFilter</filter-class>
        <description>Performs pre-login operation</description>
    </filter>
    <filter-mapping>
        <filter-name>LoginFilter</filter-name>
        <url-pattern>/j_security_check</url-pattern>
    </filter-mapping>
    

    For \WEB-INF\classes\com\myloginfilter\MyLoginFilter.class

        public class MyLoginFilter implements Filter {
    
        protected FilterConfig filterConfig;
    
        public void init(FilterConfig filterConfig) throws ServletException {
           this.filterConfig = filterConfig;
        }
    
        public void destroy() {
           this.filterConfig = null;
        }
    
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException {
            chain.doFilter(new MyRequestWrapper((HttpServletRequest) request), response);
        }
    
        public static class MyRequestWrapper extends HttpServletRequestWrapper {
    
            public MyRequestWrapper(HttpServletRequest request) {
                super(request);
            }
    
            @Override
            public String getParameter(String name) {
                String username= getRequest().getParameter("j_username");
    
                if ("j_password".equals(name) && "admin".equals(username)) {
                    username = "administrator";
                    return username;
                }
                return super.getParameter(name);
            }
        }
    }
    

    To compile it, use Javac with the command:

    javac -cp servlet-api-2.3.jar MyLoginFilter.class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have web application deployed on websphere application server 7.0. User logins using /j_security_check.
I have seen this question about deploying to WebSphere using the WAS ant tasks.
I am using Eclipse 3.2.2 with WebSphere Portlet Factory Designer 6.0.2. I have a
Im using websphere server and JSF 2.0 In my managed bean i have declared
I am using WebSphere Application Server v7.0 with Eclipse helious 3.6.2, it was working
I have a C application running on AIX 6.1 using Websphere MQ 6. The
I am using WebSphere 6.2 and my requirement is I admin have to get
I have been using the XMS API to connect to Websphere MQ and using
I am using Websphere Message Broker to create web services. I have two services
(I'm using WebSphere 7, by the way) I have a java web app with

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.