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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:33:42+00:00 2026-05-20T14:33:42+00:00

Currently, I’m using Velocity instead of JSP, for its flexibility. For some reasons, I

  • 0

Currently, I’m using Velocity instead of JSP, for its flexibility. For some reasons, I need to distribute my web modules in jar archive, rather than war archive`.

I have read the servlet specification, though, but I didn’t find a way to programmatic invoke the jasper engine.

My idea is, split web application to several modules:

  • one top-level war module, which contains web.xml, and all 3rd-party jar dependencies.
  • other jar modules contains http servlets (jsp is a special form of servlet).

It’s very easy to embed Velocity templates in class resources, so I’m wondering if I can do the same job with JSP?

EDIT

The problem of Velocity is, we have to use some taglibs, JSF, etc. to create a rich web UI, which can’t be done by Velocity templates.

  • 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-05-20T14:33:43+00:00Added an answer on May 20, 2026 at 2:33 pm

    we have to use some taglibs, JSF, etc. to create a rich web UI, which can’t be done by Velocity templates.

    Use Facelets instead of JSP. It not only offers better templating possibilities than JSP, but it is also possible to serve Facelet files straight from classpath. Assuming that you’re still on JSF 1.x (because JSF 2.x uses by default Facelets instead of JSP and there is really no reason to prefer JSP over Facelets), then you can enable serving Facelets from JAR as follows:

    import com.sun.facelets.impl.DefaultResourceResolver;
    
    public class CustomResourceResolver extends DefaultResourceResolver {
    
        @Override
        public URL resolveUrl(String resource) {
            URL url = super.resolveUrl(resource);
    
            if (url == null) {
                if (resource.startsWith("/")) {
                    resource = resource.substring(1);
                }
    
                url = Thread.currentThread().getContextClassLoader().getResource(resource);
            }
    
            return url;
        }
    
    }
    

    which you register as follows in web.xml:

    <context-param>
        <param-name>facelets.RESOURCE_RESOLVER</param-name>
        <param-value>com.example.CustomResourceResolver</param-value>
    </context-param>
    

    To learn more about Facelets, start with this excellent developer documentation.

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

Sidebar

Related Questions

Currently I have a web service, which loads up any plugins located within its
Currently i am consuming web service from android by the method SOAP.Here i need
Currently, I'm using && and || instead of AND and OR because that's how
Currently I am using Microsoft Sync Framework to synchronize databases. I need to gather
Currently I am using HTML files for parts of my user interface. I display
currently, I`m implementing a map App with Mono4Droid and there I`m using a WebView
Currently I am trying to use a bunch of custom perl modules, test.pm as
Currently I am using Amazon Cloudfront to service static objects on my ASP.Net MVC3
Currently I have a web service running in a tomcat (http:// localhost:8080/myApp/getUsers ). My
Currently I'm doing some unit tests which are executed from bash. Unit tests are

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.