aspose file tools*
The moose likes Other Java Products and Servers and the fly likes Process simple text files as JSP in Glassfish Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Process simple text files as JSP in Glassfish" Watch "Process simple text files as JSP in Glassfish" New topic
Author

Process simple text files as JSP in Glassfish

Gabriel Haggiag
Greenhorn

Joined: Jul 07, 2003
Posts: 9
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.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
As stated, that sounds like a recipe for disaster.

What exactly are you trying to accomplish?

Bill
Gabriel Haggiag
Greenhorn

Joined: Jul 07, 2003
Posts: 9
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
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Jul 07, 2003
Posts: 9
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60990
    
  65

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gabriel Haggiag
Greenhorn

Joined: Jul 07, 2003
Posts: 9
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60990
    
  65

OK, so now I'm confused. If you're already doing it, what's your question?
Gabriel Haggiag
Greenhorn

Joined: Jul 07, 2003
Posts: 9
It doesn't work on glassfish
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Jul 07, 2003
Posts: 9
I dont get the difference.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Process simple text files as JSP in Glassfish