Home > java, Software Engineering, Web > DWR configuration using jsp

DWR configuration using jsp

To configure DWR, please place files & codes  as follows

1. /WEB-INF/lib/dwr.jar

2. /WEB-INF/lib/common-logging-1.1.1.jar

3. /WEB-INF/lib/common-logging-api-1.1.1.jar

4. /WEB-INF/lib/log4j-1.2.15.jar   which require property file log4j.properties

5. /WEB-INF/classes/log4.property has following code 

# Global logging configuration

log4j.rootLogger=WARN, stdout

log4j.logger.com.yoostar.job=INFO, stdout

log4j.logger.com.yoostar.dao=WARN, stdout
log4j.logger.org.springframework.security=WARN, stdout

# Console output…log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.conversionPattern=%d{DATE} [%p,%c{1}] %m%n

######### DWR security settings…Enable script tag remoting on LOAD so that autmated Jmeter tests can run and play nice with DWR
dwr.allowScriptTagRemoting=”false”
dwr.crossDomainSessionSecurity=”false”
# end DWR security settings
###########

8./WEB-INF/web.xml will have following code
<servlet> <servlet-name>web</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
<servlet-mapping> <servlet-name>web</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping>
<servlet-mapping> <servlet-name>web</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping>
9. /WEB-INF/dwr.xml will have following snipet
<!DOCTYPE dwr PUBLIC     “-//GetAhead Limited//DTD Direct Web Remoting 3.0//EN”     “http://getahead.org/dwr/dwr30.dtd”><dwr>  <allow>    <create creator=”new” javascript=”DwrService”>      <param name=”class” value=”com.Bmpl.webremote.DwrService”/>    </create>  </allow></dwr>

10. /WEBContent/index.jsp

<script type=”text/javascript”    src=”/BMPLParser/dwr/interface/DwrService.js”> </script><script type=’text/javascript’ src=’/BMPLParser/dwr/engine.js’></script><script type=’text/javascript’ src=’/BMPLParser/dwr/util.js’></script>

<script type=”text/javascript”>

DwrService.testMethod( function(data) { alert(“DwrService.testMethod : “+data); });
</script>

Advertisements
Categories: java, Software Engineering, Web
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: