In swagger 1.2.9-1.2.3 or old versions we have config reader com.wordnik.swagger.jaxrs.ConfigReader class, we can extend this class and we can declare swagger properties swagger.api.basepath , api.version , swagger.version etc.
But in current version of swagger 2.10-1.3.0 this class is not present. Is there any way we can move above configurations from web.xml, I want to have them in property file instead of hard coding it in web.xml.
Thanks in advance.
There's a thread explaining how to do this on the Swagger google group.
Basically, in Swagger 1.3, you need to use the SwaggerConfig class, like so:
SwaggerConfig config = new SwaggerConfig();
config.setBasePath(yourBasePathVariable);
ConfigFactory.setConfig(config);
However, you need this to occur after Swagger loads and sets the default basePath, because otherwise (if your basePath gets set first) it will be overwritten.
Here is how you can move swagger configuration to a customization code
This is particularly helpful if you are hosting your micro service on cloud foundry or IBM Bluemix or Some PaaS Cloud solution
Dependency in your pom.xml
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
Swagger configuration
package com.ibm.api;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.jaxrs.config.DefaultJaxrsConfig;
public class SwaggerConfigReader extends DefaultJaxrsConfig {
/**
*
*/
private static final long serialVersionUID = 1638783798880874518L;
#Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
//contextPath will be null for host2 and /xyz for host1.
String contextPath = config.getServletContext().getContextPath();
BeanConfig beanConfig = new BeanConfig();
beanConfig.setVersion("1.0.0");
beanConfig.setTitle(Result.IMPLEMENTATION + " API Documentation");
beanConfig.setSchemes(new String[] {
"http", "https"
});
beanConfig
.setResourcePackage("com.ibm.api");
beanConfig.setBasePath(contextPath + "/rest");
beanConfig.setScan(true);
}
}
Web.xml entries
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Restful Web Application</display-name>
<servlet>
<servlet-name>jersey-serlvet</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>io.swagger.jaxrs.listing,com.ibm.api</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey-serlvet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>SwaggerBootstrap</servlet-name>
<servlet-class>com.ibm.api.SwaggerConfigReader</servlet-class>
<init-param>
<param-name>scan.all.resources</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
</web-app>
Note the com.ibm.api.SwaggerConfigReader registered as swagger configuration and com.ibm.api registered in packages to be scanned for rest APIs. Also note beanConfig.setBasePath(contextPath + "/rest");
Now your swagger.JSON configuration will show up as http://localhost:8080/jax_rs/rest/swagger.json. Point swagger UI to this URL and you will see swagger documentation.
The code is here: https://github.com/sanketsw/jax_rs_REST_Example
Related
Im new to JSF 2. My question is related to BalusC's answer to this question jsf2 ajax update parts based on request parameters I tried the kickstart code BalusC posted and I encountered an EL parsing error:
/nameofpage.xhtml #12,64 rendered="#{bean.panels.contains('u1')}"
Error Parsing: #{bean.panels.contains('u1')}
I guess that this is caused because I'm not running a Servlet 3.0 / EL 2.2 capable container with a /WEB-INF/web.xml declared as per Servlet 3.0 spec. I'm using Tomcat 6.
BalusC suggested in his answer to create a custom EL function. But how do I accomplish this using a custom EL function? Or can this be fixed by just configuring certain parts of my project?
Below is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
First create a final class with a public static method which does exactly the job you want:
package com.example;
import java.util.Collection;
public final class Functions {
private Functions() {
// Hide constructor.
}
public static boolean contains(Collection<Object> collection, Object item) {
return collection.contains(item);
}
}
Then define it as a facelet-taglib in /WEB-INF/functions.taglib.xml:
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
<namespace>http://example.com/functions</namespace>
<function>
<function-name>contains</function-name>
<function-class>com.example.Functions</function-class>
<function-signature>boolean contains(java.util.Collection, java.lang.Object)</function-signature>
</function>
</facelet-taglib>
Then familarize Facelets with the new taglib in the existing /WEB-INF/web.xml:
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/functions.taglib.xml</param-value>
</context-param>
(note: if you already have the javax.faces.FACELETS_LIBRARIES definied, then you can just add the new path semicolon separated)
Then define it in the Facelets XHTML file as new XML namespace:
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:func="http://example.com/functions"
...
>
Finally you can use it as intended:
rendered="#{func:contains(bean.panels, 'u1')}"
As a completely different alternative, you can also include JBoss EL in your project. It works on Tomcat 6.0 and you'll be able to invoke non-getter methods in EL. Drop jboss-el.jar file in /WEB-INF/lib and add the following to your web.xml:
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>
Since EL 2.2 there's another approach: create an #ApplicationScoped bean with methods in turn referring to those static functions. See also a.o. Utility methods in application scoped bean.
When trying to logout my application I'm having the following error message :
com.sun.faces.context.FacesFileNotFoundException: /index.xhtml Not Found in ExternalContext as a Resource
To logout I'm going though the following steps inside PhaseListener.beforePhase(PhaseEvent phaseEvent) :
// Redirect to index.html
NavigationHandler nh = fctx.getApplication().getNavigationHandler();
String action_outcome = "/index.html";
nh.handleNavigation(fctx, null, action_outcome);
My web.xml is as follow :
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID"
version="3.0">
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>trinidad</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>Restrict raw XHTML Documents</display-name>
<web-resource-collection>
<web-resource-name>XHTML</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
I do not have index.xhtml in my app, but I do have and want to keep it index.html file.
Why is my outcome_action given to NavigationHandler rename to index.xhtml ?
How could I avoid it ?
The NavigationHandler expects a JSF page, not a non-JSF page. Moreover, you're there actually not sending a real redirect at all, on the contrary to what the code comment says there. You're just performing a forward here.
Performing a real redirect would be the solution to your problem. It's to be done as below:
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
ec.redirect(ec.getRequestContextPath() + "/index.html");
See also:
What is the difference between redirect and navigation/forward and when to use what?
How to navigate in JSF? How to make URL reflect current page (and not previous one)
Unrelated to the concrete problem, doing authorization job in a phase listener stinks. Have you considered a servlet filter?
See also:
Limitations of using a PhaseListener instead of a Servlet Filter for authorization
Failing to redirect from JSF phaselistener
How to invalidate session in JSF 2.0?
Haven't really used Web Sphere Application Server (8.5.5) before neither I have any actual experience with JNDI alltogether and I have even been working with Shiro only for couple of days.
Still I would need to get a custom Shiro-realm to the JNDI so that both the application and the Shiro would share a common instance of the realm (and so that the realm would have access to ejb-resources via inject)
This is how I have done this so far:
WEB-INF/shiro.ini
[main]
realmFactory = org.apache.shiro.realm.jndi.JndiRealmFactory
realmFactory.jndiNames = realms/ShiroRealm
...
A custom Shiro-Realm (just mocks for now)
import javax.faces.bean.SessionScoped;
#SessionScoped
public class MockRealm extends AuthorizingRealm implements Serializable {
#Inject public UserMB user;
#Override protected AuthenticationInfo doGetAuthenticationInfo(...) ...
#Override protected AuthorizationInfo doGetAuthorizationInfo(...) ...
}
A custom CredentialsMatcher
public class MockCredentialsMatcher implements CredentialsMatcher {
#Override public boolean doCredentialsMatch(...) ...
}
And I have a shiro-startup class as follows
#Singleton
#Startup
public class ShiroStartup {
#Inject
private MockRealm realm;
#PostConstruct
public void setup() {
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
InitialContext ic = new InitialContext(env);
try {
Object obj = ic.lookup("realms/ShiroRealm"); // This is expected to fail when the application is published
} catch (NamingException ne) {
this.realm.setCredentialsMatcher(new MockCredentialsMatcher());
ic.rebind("realms/ShiroRealm", this.realm);
System.out.println("Bound: realms/ShiroRealm";
}
} catch (NamingException e) {
e.printStackTrace();
}
}
}
I found a post earlier that suggest to do bridge the injection-scopes this way and actually this works, but only when this code is run on GlassFish (v4).
I'm pretty sure this should also work with WAS 8.5.5, but can't resolve this error. (maybe trivial to someone, but ...)
The error I get is a complain that the jndi name "realms/ShiroRealm" is not found / can not be used. (I'll post the exact Exception later, currently having trouble running the server at all)
I have not found how the name should be given (and this is starting to take time, even that I'd expect this kind of information would be easy to find), so I post in here in hopes that some one could advice me.
(Note: I copied here only the parts I thought relevant. When debugging the code when run on GlassFish, I get hits in all correct places when expected)
// Update (for completeness, though I do not think these are relevant for this question)
The contents of beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://docs.jboss.org/cdi/beans_1_0.xsd">
<interceptors>
<class>com.example.interceptor.ShiroSecuredInterceptor</class>
</interceptors>
</beans>
The contents of ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
version="3.1">
<interceptors>
<interceptor>
<interceptor-class>com.example.interceptor.ShiroSecuredInterceptor</interceptor-class>
</interceptor>
</interceptors>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>*</ejb-name>
<interceptor-class>com.example.interceptor.ShiroSecuredInterceptor</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
</ejb-jar>
The constents of web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID"
version="3.1">
<display-name>shiroTest</display-name>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
<welcome-file-list>
<welcome-file>Login.xhtml</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
</web-app>
// UPDATE
finally got the server back online and was able to get the Exception thrown
[4/17/15 12:16:22:053 EEST] 00000043 SystemErr R javax.naming.NameNotFoundException: Context: securityoffNode01Cell/nodes/securityoff/servers/server1, name: realms/ShiroRealm: First component in name realms/ShiroRealm not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
Incase the full stack trace is important, I put it on the pastebin for a while.
http://pastebin.com/sANAqCJL
(Realized that the project that I used to test this configuration on GlassFish is a simple 'war'-project where the actual implementation deployed on WAS is in ear. May or may not be relevant between these servers.)
// UPDATE 2
After reading this (not completely yet, still reading and testing):
http://www-01.ibm.com/support/knowledgecenter/SS7JFU_7.0.0/com.ibm.websphere.express.iseries.doc/info/iseriesexp/ae/cejb_bindingsejbfp.html
I tried using a name: "ejblocal:MockRealm".
Well, this seems to be ok for it. However continued with this same issue, the following Exception is now.
[4/17/15 13:17:47:536 EEST] 000000ac webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor]: java.lang.IllegalStateException: Unable to look up realm with jndi name 'ejblocal:MockRealm'.
It looks like the jndi name used in shiro.ini still needs to fixed something else, but the 'ejbLocal:MockRealm" or "simply "MockRealm" is not ok.
I hope to find solution soon, I will post a real answer then.
Have you tried removing the "env" parameter that you're passing here?
//InitialContext ic = new InitialContext(env); //OLD
InitialContext ic = new InitialContext(); //NEW
The reason is that when Shiro attempts to lookup '"realms/ShiroRealm' it is going to do it with an InitialContext with no environment parameters.
If the environment you've defined is required you will have to create a RealmFactory that provides the same property to Shiro.
package com.acme.realm.jndi;
import java.util.Properties;
import javax.naming.Context;
public class WASJndiRealmFactory extends JndiRealmFactory {
#Override
public void setJndiNames (String commaDelimited) throws IllegalStateException {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
setJndiEnvironment(p);
super.setJndiNames(commaDelimited);
}
}
Then you will have to update your 'shiro.ini' to reference the new RealmFactory.
[main]
realmFactory = com.acme.realm.jndi.WASJndiRealmFactory
I occured to browse this a bit dated question.
I could not configure the Shiro so that it worked with WAS. Instead I put manually the common data that both "scopes" needed into the JNDI context.
This way I was able to lookup in Shiro the things that were needed from the actual application.
With this solution the ShiroStartup was no longer needed.
I am using PrimeFaces 3 and trying to upload a file but when I debug the file is always null.
Below you can see my code. Can anyone spot what is the issue?
<h:form enctype="multipart/form-data">
<p:fileUpload value="#{uploadFileMB.file}" mode="simple" />
<p:commandButton value="Submit" ajax="false" action="#{uploadFileMB.submit()}"/>
<h:outputLabel value="#{uploadFileMB.text}" />
</h:form>
import javax.enterprise.context.SessionScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import org.primefaces.model.UploadedFile;
#ManagedBean
#SessionScoped
public class UploadFileMB {
UploadedFile file;
String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public UploadedFile getFile() {
return file;
}
public void setFile(UploadedFile file) {
this.file = file;
}
public void submit(){
System.out.println("Trial "+file);
UploadedFile a=file;
if(file==null)
text="not uploaded";
else
text=file.getFileName()+" uploaded";
}
/** Creates a new instance of UploadFileMB */
public UploadFileMB() {
}
}
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
And the filter in both web.xml and faces.config
I have tried a number of suggestions and debugged it many times but I can't figure it out.
This is my faces-config:
<?xml version='1.0' encoding='UTF-8'?>
<!-- =========== FULL CONFIGURATION FILE ================================== -->
<faces-config version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId> commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId> commons-io</artifactId>
<version>2.1</version>
</dependency>
<lifecycle>
<phase-listener>security.SecurityFilter</phase-listener>
</lifecycle>
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
<init-param>
<param-name>uploadDirectory</param-name>
<param-value>C:/home/vanessa/Desktop</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
</faces-config>
I think these two libraries are missing in your project ; commons-fileupload and commons-io . if your project is maven you can add these to your pom.xml ;
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId> commons-fileupload</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId> commons-io</artifactId>
<version>2.1</version>
</dependency>
else then download them from http://commons.apache.org and add your lib .
Well, I see three mistakes in your code, it could solve your problem I don't guarantee anything.
First, you are importing #SessionScope from wrong package, it should be javax.faces.bean.SessionScoped, the other class is ment to use with CDI.
Second, make your properties in bean private I am not sure if it counts as a property like this. Also this is a good practise to hiding field as much as possible.
Third, and most important, change actionto actionListenerand try it. If still doesn't work, try to add to your method parameter ActionEvent event (and be carefull to choose right package, I once imported ActionEventfrom javax.awt. and spend two hours figuring out where could be the problem:-)
I am using DWR for one of my application. I have setup the environment and clear about how to make call to Java functions using the ClassName.method() approach. But I want to use jsonp style approach mentioned here http://directwebremoting.org/dwr/introduction/remoting_options.html.
I tried creating sample application and run on tomcat. But I was unable to get any result from server. It was saying 404.
This is my call:
$.post("/DWRDemo/dwr/jsonp/Demo/sayHello/" + name, { },
function(data) {
dwr.util.setValue("demoReply", data.reply);
}, "jsonp");
}
where
DWRDemo: Application name
Demo: class name
sayHello : method name
=====================================================================
dwr.xml
<create creator="new" javascript="Demo">
<param name="class" value="org.getahead.dwrdemo.simpletext.Demo"/>
</create>
=====================================================================
web.xml
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<display-name>DWR Servlet</display-name>
<description>Direct Web Remoter Servlet</description>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>jsonpEnabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
=====================================================================
And I have included the required .js files in my html
====================================================================
Is there any other configuration that I am missing.
Appreciate your help.
Regards,
Ronak
I have found the resolution. Actually, I was using DWR.jar (version 2.7). But looks like it does not support servlet call. I tried with DWR.jar (version 3.0) and it worked straight away.