Posts

Showing posts with the label glassfish

Purpose of Glassfish's “generated” directory

Purpose of Glassfish's “generated” directory I need to better understand what goes into the "generated" directory inside a domain folder of Glassfish. I can see that deployed applications store some resource files in there, (xmls, properties, manifests...) but don't really understand why. Google was not very useful this time. Could someone point me to some relevant documentation? Thanks. Edit: I need to know these details because i want/need to delete this folder when restarting the server. 2 Answers 2 After experimenting a bit i found that i could delete all of the following directories inside the GF domain and have them created when GF starts: applications autodeploy generated logs osgi-cache The first 2, of course, if you redeploy your applications. I usually delete these in development after a GF crash. To complement sebi's answer, make sure your server is stopped whe...

doFilter called twice, intended behaviour?

Image
doFilter called twice, intended behaviour? I'm working through the Java EE servlet tutorial and tried the mood example. I noticed the doFilter is getting called twice, once the servlet call is in the chain and the second time it isnt. I added some printlns in the TimeOfDayFilter.java and in the MoodServlet.java to show this. TimeOfDayFilter.java: ... System.out.println("TimeOfDay before"); //added chain.doFilter(req, res); System.out.println("TimeOfDay after"); //added ... MoodServlet.java: ... response.setContentType("text/html;charset=UTF-8"); System.out.println("MoodServlet"); //added PrintWriter out = response.getWriter(); ... The result from the glassfish server (3.1) window when calling the servlet is the following: INFO: mood was successfully deployed in 406 milliseconds. INFO: TimeOfDay before INFO: MoodServlet INFO: TimeOfDay after INFO: TimeOfDay before INFO: TimeOfDay ...