Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Process simple text files as JSP in Glassfish

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I wish to instruct my web container, in my case Glassfish 3.1.2, to handle non-jsp files as JSP.

For example,
I wish that all files that ends with ".js" will be processed as JSP.

Thanks,
Gabriel.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As stated, that sounds like a recipe for disaster.

What exactly are you trying to accomplish?

Bill
 
Gabriel Haggiag
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,

For example, I wish to expose in my javascript files, enums from Java.
I also generate my JNLP files dynamically.

Thanks,
Gabriel.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Literal interpretation of:

processed as JSP



would imply having the JSP processor use the rules of JSP syntax to create a java file which gets compiled to a servlet.

You appear to be wanting to use data text files as input to the creation of a JSP, not the same thing. Such things are typically handled by custom helper classes - JavaBeans for example.

Bill
 
Gabriel Haggiag
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

would imply having the JSP processor use the rules of JSP syntax to create a java file which gets compiled to a servlet.



This is correct.

You appear to be wanting to use data text files as input to the creation of a JSP, not the same thing. Such things are typically handled by custom helper classes - JavaBeans for example.



This is not correct :)

So back to the question, in other words, using your terminology,
I want to use the JSP processor to process files that are written in JSP syntax, but have a different file extension.

Gabriel.
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I remember seeing a way to do this in Tomcat -- but, no, I don't remember the exact details as it's not something I would ever do myself.

Have you considered a build-time rather than a run-time solution for getting your constants into the static resources?
 
Gabriel Haggiag
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually I am migrating from Tomcat to Glassfish, and it works fine under Tomcat, and it is successfully deployed on many sites around the world.
I know that many people are familiar with the full power JSP engine. That's OK.
But believe me, it's more powerful then you can imagine.

Anyhow, thanks for your good intentions.

Gabriel
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, so now I'm confused. If you're already doing it, what's your question?
 
Gabriel Haggiag
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't work on glassfish
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Tomcat, the mapping in the default web.xml:


handles this. What does Glassfish use for mapping?

Bill
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jaknow - if the original post had said: "I have this working in Tomcat but cant get it working in Glassfish" it would have saved a LOT OF TIME to get to the right place.

 
Gabriel Haggiag
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont get the difference.
 
"To do good, you actually have to do something." -- Yvon Chouinard
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic