Laliwala IT Services

Laliwala IT Services
Website Development

Sunday, February 20, 2011

servlet-mapping


asile elisa : servlet-mapping





hi everyone,





I will use a servlet in my project





well I dont know how to configure it in web.xml










I dont know what to put in url-pattern





is it the portletURL that will call the servlet and where can I find it??





thanks in advance.



Mazhar Anwar : Hi,





Do you want to define your servlet in a plugins portlet?





By web.xml do you mean web.xml of the plugins portlet?





If you are using plugins-portlet, you can write your servlet mapping as





<servlet-mapping>

<servlet-name>TestServlet</servlet-name>

<url-pattern>/TestServlet/*</url-pattern>

</servlet-mapping>








and you can call it as /YOUR-PORTLET-CONTEXT-PATH/TestServlet in URL.





In case of ext, I thing you dont need portlet context path and you can access it directly with /TestServlet in URL.





Regards,

No comments:

Post a Comment