• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

A jsp that has an XML file extension, server mappings

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am wanting to make a dynamic XML file, sitemap.xml.

I want this to change when the content held in the database changes.

I have done this in PHP but do not know whow to do this in java.

I would expect that somewhere in my server (tomcat) I can map sitemap.xml to sitemap.jsp, possibly. So when I call sitemap.xml it will infact run sitemap.jsp and return the dynamic content.

Is this possible?

Thanks in advance
 
Sheriff
Posts: 67753
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 guess, but it certainly seems like a lot of jumping through unnecessary hoops. Why not just have a servlet to serve the XML content? Much easier. Why do you feel you need a JSP?
 
David Rocks
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can do that as well I suppose.

So I would just set up the mapping sitemap.xml straight to the servlet?

I just always use JSPs and never servlets, not written one in years I think.

'He who's only tool is a hammer only sees nails' I suppose.
 
Bear Bibeault
Sheriff
Posts: 67753
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
Um yeah. You can pound in a screw with a hammer, but ...

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Rocks wrote:I just always use JSPs and never servlets, not written one in years I think.


That seems backwards to me.
 
David Rocks
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:

David Rocks wrote:I just always use JSPs and never servlets, not written one in years I think.


That seems backwards to me.



Why, I could be a swing developer for all you know.

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You use JSPs in Swing?
 
David Rocks
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:You use JSPs in Swing?



I would not have a problem in putting the logic into a JSP and mapping the xml file to the jsp.

I wrote the servlet on the train home and I thought about the xml file as a jsp or a servlet.

If I was to do a sitemap.jsp with a sitemap.xml the it would be natural to place the same logic of a sitemap.jsp into a sitemap.xml.

There is no specific architectural reason why the logic has to go into a servlet.
 
Sheriff
Posts: 28383
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:

David Rocks wrote:I just always use JSPs and never servlets, not written one in years I think.


That seems backwards to me.


But pretty normal around here. Just watch and you'll see all the posts which say "Don't do that in your JSP, only do what is necessary to output the view". That's a large fraction of the threads about JSP. I don't understand why people only use JSPs either, it doesn't seem very professional to me, but then not everything has to be professionally done.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic