• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

FrontMan Commands ?

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to add multiple commandsPath to the descriptor?

i want to seperate my commands into different packages for different modules of my program
It make it easier to keep track of my classes

 
Sheriff
Posts: 67752
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've added this ability to Front Man 2 as I've found that I've needed it myself.

I'll be looking for beta testers soon. Interested?
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes very much so. This is soo much easier to maintain than adding all the mappings to the descriptor.

I am refactoring my admin project using this right now and hope to refactor an ecommerce site using this same structure.
 
Bear Bibeault
Sheriff
Posts: 67752
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, cool. Watch for a notice in the BA forum. I just need to find some time to finish the documentation and it'll be ready for testing.
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have another question about the descriptor with fromtman
for the welcome-file-list in the passed i have entered my mapped servlet name so it goes to that servlet when you got to
www.mysite.com

this still works fine <welcome-file>jsp/index.jsp</welcome-file>

but if i were to do <welcome-file>dispVendors</welcome-file> it doesnt work.

what would be the correct format using frontman?

below is the current web.xml i am using

thanks
john


 
Bear Bibeault
Sheriff
Posts: 67752
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
If dispVendors is a command, the URL will need the /command prefix.
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok the following works but when the page displays all my images arent showing up



this is my directory hiearchy


in my jsp i have it go up one folder to images

../images/bolt.gif

using http://127.0.0.1:8080/NID/command/testCommand and everything displays fine

 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok if i remove ../ before all the images in the jsp file they display.

Im just not understanding why that is.
 
Bear Bibeault
Sheriff
Posts: 67752
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
Page-relative references are death in web applications. Use server-relative references that begin with the context path.

Think about it for a minute: the browser is trying to find the image file in the file system relative to the current URL. That's fine in a static site where the URLs represent folders. But in a web app, the URLs are mapped and have nothing whatsoever to do with the file system.

By removing the .. you got it to accidentally work. Don't depend upon that. Use server-relative addresses as outlined in this JSP FAQ.
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks worked like a charm. also answered alot of questions i never took the time to learn.
 
Bear Bibeault
Sheriff
Posts: 67752
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
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you find yourself mixing the command classes with regular servlet classes?

like just using the command classes for url links and POST, and to use regular servlets for lets say displaying the page after the post?

Trying to figure out the neatest way to structure my new program.


**In addition is there a way to implement a filter and not to have to map all the pages in the web.xml using fromtman?

 
Quick! Before anybody notices! Cover it up with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic