Static Pages with no model or controller

Posted on 2008-11-07
Last Modified: 2013-11-11
I have a web app that has a few pages that are static HTML pages that do not have a model. I want these pages to only be viewed after the client has logged in, but I don't want to have to create controllers for each of them when they do not have models and will not change. I was thinking about creating one controller for all the static pages, but I don't know if this is the best approach or even if it is possible.
Any advice would be appreciated.
Question by:iharmony24
    LVL 27

    Accepted Solution

    You could change the HTML files to JSP files and then check for a session-scoped variable before allowing access.   Or you could write a Filter that could prevent access to the HTML files.   Which way do you want to go ?
    LVL 27

    Expert Comment


    Author Closing Comment

    I ended up taking your first approach where I converted the html pages to jsp. I have a spring servlet that maps the request to a httpInterceptor where it makes sure that the session variable has been set. If the check passes, the servlet then maps to one controller (handeling all static pages) that parses the uri for the view name, which it then displays.
    Thanks for your help,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now