Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe14.iad.POSTED!00000000!not-for-mail From: Owen Jacobson Newsgroups: comp.lang.java.programmer Message-ID: <2011052323205951615-angrybaldguy@gmailcom> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: Dealing with application names in a JEE web app User-Agent: Unison/2.1.4 Lines: 29 X-Complaints-To: abuse@UsenetServer.com NNTP-Posting-Date: Tue, 24 May 2011 03:20:59 UTC Date: Mon, 23 May 2011 23:20:59 -0400 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4512 On 2011-05-23 15:11:32 -0400, markspace said: > Hi all, > > I'm delving more heavily into JSP/Servlets and JSF at the moment. I've > found something that looks like a questionable design issue by the JEE > folks at Sun (now Oracle, of course) and I'd like to pick your brains > about how you might deal with it. > > Basically, when developing a JEE web app, the application name gets > inserted into every URL and associated path. If my app is named > TechDarwinia, for example, then all URLS look like this: > > http://localhost:8080/TechDarwinia/ > http://localhost:8080/TechDarwinia/faces/readPost.xhtml > http://localhost:8080/TechDarwinia/rsrc/css/style.css > > The problem is of course that the web app could be renamed anything by > the deployer/sysop, and I've got strings hard coded to that app name > TechDarwinia. > > So how do folks write their apps so that they can handle being deployed > under different names? and equivalent tools that inspect the actual context path (the "/TechDarwinia/" part of your URL) for the request, largely. -o