RSS Feed
15
October
2003

Tips 'n' Tricks: How to keep JSP compilation results with JBoss/Jetty

Posted by woeye | Comments: 2

If you want to keep your JSP compilation results between server restarts you have to tell Jetty where to put the results. Otherwise Jetty will use a different directory on each restart. The simplest way is to add an init-parameter in webdefault.xml: [code] jsp org.apache.jasper.servlet.JspServlet scratchdir /tmp/jetty 0 [/code]

15
October
2003

JBoss, Jetty, welcome-file and index.do

Posted by woeye | Comments: 4

Unfortunately it is a little bit tricky to get the default welcome file index.do working with Struts and Jetty. Suppose you have th following web.xml:

...
<welcome-file-list>
  <welcome-file>index.do</welcome-file>
</welcome-file-list>
...
and you have configured the ActionServlet to listen on *.do requests. Then you would assume that
http://some.url.com/index.do
would work? Right? No! I guess the problem is that the default servlet (which handles the welcome-file stuff) looks for the file index.do on the filesystem. Unless there is no such file the ActionSerlvet will never be called.
The trick is to simply add an empty index.do file in the root directory of your WAR. That's it =)

15
October
2003

Why you should add the encoding property to your javac ant task

Posted by woeye | Comments: 0

Yesterday I compiled a project on my iBook and deployed the resulting jar files. Today the customer called me and told me that the CSV parser wasn't working anymore. After some research I found out that javac on OS X doesn't use ISO-8859-1 as the default encoding (I guess it uses MacRoman). Acutally the problem is that we have german umlauts in some of our source files. Therefore it is a good idea to specifiy the enconding property in your ant task:

<javac encoding="iso-8859-1" ...
...

15
October
2003

Struts and auto fill ... watch out =)

Posted by woeye | Comments: 0

I was working on an ActionForm which has the property password. When I was testing the JSP view I wondered why the field always was filled although I never called the corresponding setter in the action. "Damn", I thought. "Where does this stupid value come from?" I had no clue. Then suddenly a light flashed through my mind: Mozilla has a nice feature called "auto fill forms" ... oh my =)

15
October
2003

Thoughts about caching with Struts Actions, Tiles and JSP

Posted by woeye | Comments: 2

Talking to the database on each request is not necessary because the content of my weblog does not change very often (for now =) ). So I like the idea of using a cache. Whenever I add a new entry I could send a notification to the cache and the cache would be flushed. So far so good. The tricky thing now is that I am using Tiles and putting a cache taglib into the tile would have no effect because the correspondig Action, which talks to the database, would still get called. Therefore I need a cache logic before the Action gets called. Currently I think the best solution would be to write a special filter. The filter would cache a defined URL, e.g. http://woeye.highteq.net/weblog/show.do?author=woeye and flush the cache on special events. Perhaps I should take a look at OSCache from OpenSymphony?

Any ideas or suggestions?

« 1 2 3 ...  23 24 25 26 27 ...  30 »