Re: [ginp-users] ginp issues
Brought to you by:
burchbri,
dougculnane
From: Doug C. <do...@cu...> - 2005-02-28 20:16:28
|
Thanks for the Properties file. I have committed it to the cvs repository. Will add a flag in the w2k4 style later. Thanks for your feedback. The struts Action interface implementation idea sounds very interesting as an additional feature I will put it in the ToDo list so it is not forgotten. I think I want to get the data storage right before this gets done, but it sounds like a worthwhile thing to investigate later. Thank also for the patch which I think Justin will look at. All the best, Doug Gleb Starodubtsev wrote: >Hi guys, > >Here is Russian resources file and some more comments... > >In GinpEnv constructor you do: > >public GinpEnv(HttpServletRequest req) throws MalformedURLException { > String reqUrl=req.getRequestURL().toString(); > String cPath=req.getContextPath(); > String rootUrl=reqUrl.substring(0,reqUrl.indexOf(cPath)+cPath.length()); > if (rootUrl.indexOf(cPath)<=0) { > rootUrl+=cPath; > } > this.url=new URL(rootUrl); >} > >Imagine that web application is configured without specific context path, >then cPath is "" and >=> rootUrl gets "" too => MalformedURLException > >Consider something like: > >public GinpEnv(HttpServletRequest req) throws MalformedURLException { > StringBuffer basePath = new StringBuffer(); > >basePath.append(req.getScheme()).append("://").append(req.getServerName()); > inPot iPort = req.getServerrt(); > //do not append generic HTTP ports > if ((iPort != 80) && (iPort != 443)) { > basePath.append(":").append(iPort); > } > basePath.append(req.getContextPath()); > String rootUrl = basePath.toString(); > System.out.println("rootUrl: " + rootUrl); > this.url = new URL(rootUrl); >} > >And one more time, please consider adding two classes implementing Struts >Action interface. At least GalleryAction and PictureAction with content >similar to your servlets classes and forwards in correct places would >completely decouple ginp from any hardcoded locations without any config >changes...(for Struts users only though). So it would be possible to use >ginp as a jar library completely flexible to existing app. > >Thanks for your work, >Gleb > > > > > -- Doug Culnane do...@cu... www.culnane.net |