Showing posts with label struts2. Show all posts
Showing posts with label struts2. Show all posts

Tuesday, September 4, 2012

Weblogic disabling freemark debug messages

Recently we migrated our applications to Oracle weblogic server (OAS 11g) and we noticed that the application log file is filled with debug messages from freemark like the one below:
<Notice> <Stdout> <<BEA-000000> <DEBUG   13467   [freemark] ():
I searched for options to turn off freemark using the logger option and it did not work.  The reason could be that the application is not using and logging configuration (no log4j or jdk logging) and oracle diagnostic logging is picking up the logs.

We also have stdout redirecting to the log file.  We have the logger configuration set to debug level as it is the development environment.  However, I do not want the freemarker logging to fill up the log file.  The solution I ended up implementing was to create a log filter to disable the freemarker log messages.   I am not sure if this is the best way or not, but this is the only way I could turn off the freemarker debug message and leave the rest of the debug messages on.

Here is the log filter configuration.  The create a log filter click on the domain name on the weblogic console and go to Configuration->LogFilters
Here is the log file configuration that I used in the development environment. (For production environment, I would recommend setting the log levels to Warning so the log files are not clogged up with debug messages)

Tuesday, June 7, 2011

Struts2 navigate away from error pages

Struts 2 provides a nice workflow interceptor that makes sure there are no validation errors before allowing the interceptor chain to continue.

This will also prevent the user from navigating away to a different method in the same action. Sometimes that is not the desired behavior we like. For example, if the user is editing an item and there is a validation error and the user does not want to fix the validation error, however they choose to navigate to a different page on the same action, the workflow interceptor will prevent the user and put them back to the edit page.

If the desired behavior is to let them proceed to to another page, you can exclude those methods in the interceptor configuration similar to the following example.
<interceptor-ref name="defaultLoginStack" >
         <param name="validation.excludeMethods">doInput,doList</param>
         <param name="workflow.excludeMethods">doInput,doList</param>
</interceptor-ref>
In the above example, if the user tries to access the doList or doInput methods the validation will be skipped and the workflow will allow to continue even if the previous page had errors.