Annotation « Development « JSP-Servlet Q&A





1. How can I get access to the HttpServletRequest object when using Java Web Services    stackoverflow.com

I'm using Java 6, Tomcat 6, and Metro. I use WebService and WebMethod annotations to expose my web service. I would like to obtain information about the request. I tried the ...

2. @WebServlet annotation support in java 1.6.013    stackoverflow.com

I'm stepping into the world of Servlets and 3.0 in particular and I saw certain methods and annotations used in examples and tutorials which talked about this being available when JAVA ...

3. Servlet 3.0 annotations     stackoverflow.com

Is it possible to set welcome-file tag from standard web.xml file by servlet 3.0 annotation ?

<welcome-file-list>
        <welcome-file>PageName.html</welcome-file>
</welcome-file-list>

4. Would Servlet 3 annotations enable secret backdoor access?    stackoverflow.com

I hope people don't mind me asking a question which is slightly future gazing. Please forgive me if my understanding is incorrect (and please put me right!). Servlet 3 ...

5. @Override for interface methods causes JSP compilation to fail    stackoverflow.com

For some reason, putting @Override on methods overriding interface methods causes JSP compilation to fail in weblogic. Everything is definitely running off of JDK 1.6.0_14, but this Java 5'ism still persists. Oddly, ...

6. Correct syntax for javax.servlet.annotation.ServletSecurity    stackoverflow.com

Has anybody got a code sample for javax.servlet.annotation.ServletSecurity annotation. I have had a look around but all I find are javadoc pages which won´t tell you how javax.servlet.annotation.ServletSecurity and javax.servlet.annotation.HttpMethodConstraint fit together ...

7. Servlet Security Annotation Error    stackoverflow.com

i have coded a login page using programmatic approaches but it does not successful when the code have roles

@DeclareRoles("User")
@WebServlet(name = "LoginController", urlPatterns = {"/LoginController"})
@ServletSecurity(@HttpConstraint(transportGuarantee= ServletSecurity.TransportGuarantee.NONE, rolesAllowed={"User"}))
public class LoginController extends HttpServlet {

 ...

8. How is annotations support in jsp implemented in sitebricks?    stackoverflow.com

Here is an example from the SiteBricks user guide:

<html>
<body>
    @ShowIf(true)     <----- I'm impressed with this line
    <p>${message} from Sitebricks!</p>
</body>
</html>
I'm ...

9. @WebServlet annotation not recognized; init doesn't run    stackoverflow.com

I'm trying to learn annotations. I currently have a webapp that runs an init() when the app is started in Tomcat. The following code works... web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
     ...





10. Servlet 3.0: where is @WebServletContextListener?    stackoverflow.com

I am trying to follow a Servlet 3.0 tutorial which refers to @WebServletContextListener. However, I cannot find such an annotation in my javaee-web-api-6.0.jar dependency (I am using maven). So, where ...

11. @WebServlet annotation and error 404    stackoverflow.com

First of all: I use glassfish 3.1 + elicpse jee indigo. I want to testing cache solutions with javaee so I made a dummy app. I have a big generated database and ...

12. Replace a context-param element with a Servlet 3.0 annotation    stackoverflow.com

Given: a Java EE 5 web app that has a web.xml that has a snippet like

<context-param>
    <description>c</description>
    <param-name>a</param-name>
    <param-value>b</param-value>
</context-param>
What would I need ...

13. Use cases for @WebInitParam    stackoverflow.com

Since the Servlet 3.0 specification there is the possibility of declaring servlet mapping metadata as annotation on the servlet class:

@WebServlet(name="appInfoServlet", urlPatterns ="/appInfo", initParams = @WebInitParam(name="ocwd.deployer.email", value="admin@example.com"))
public class AppInfoServlet extends HttpServlet {

}
What ...

14. What Is Annotation?    coderanch.com

15. annotations loading in VM    coderanch.com

16. Annotation inheritence limitations    coderanch.com





17. Server independent JNDI name annotation    coderanch.com

18. custom annotation    coderanch.com

20. secure web service annotation?    coderanch.com

21. difference between annotations    coderanch.com

22. Difference in specyfying Annotations    coderanch.com

24. What are Annotations?    coderanch.com

26. why can't we use Annotation for when we Creating a Java Stand-Alone Client    coderanch.com

Dependency injection of EJB components in a stand alone client is not possible because there is no container available to do the injection. However, there are application client containers which you can use to run that standalone client as an application client, so that injection becomes possible. You will have to check the documentation of the application server you are using ...

29. package javax.servlet.annotation does not exist    coderanch.com

Hello, I am facing the following error while compiling the code: C:\Program Files (x86)\Java\Tomcat7.2\webapps\ROOT\WEB-INF\classes>javac FileUpl oad.java FileUpload.java:9: package javax.servlet.annotation does not exist import javax.servlet.annotation.WebServlet; ^ FileUpload.java:30: cannot find symbol symbol: class WebServlet @WebServlet(name="FileUpload", urlPatterns={"/FileUpload"}) ^ FileUpload.java:154: warning: sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a future release String encodedString = new sun.misc.BASE64Encoder().encode(fileConten t); // changes done. ^ Note: ...

30. Documentation for Java EE Annotations    coderanch.com

I've been searching and searching for a list of annotations, their syntax, properties, etc. but haven't been able to find anything. Does anyone know where I might find such a thing? For example: @MessageDriven(mappedName = "jms/Queue", activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") , @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }I'm wonder what the syntax is, what these options ...

33. servlet annotation    coderanch.com

37. Comment: Follow up on Servlet 3.0 Security Annotations    java.net

Bheem Shukla wrote: > Shing Wai, > > Thanks a lot for looking . > > No error messages seen in log > Snippet of latest log deployment : > ------------------------------------------------------------------------------------------------------------------ > [#|2010-01-19T12:06:26.762-0600|INFO|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=Thread-1;|Loading > application servlet3web at /servlet3web|#] > [#|2010-01-19T12:06:26.762-0600|INFO|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=11;_ThreadName=FelixStartLevel;|Loading > application servlet3web at /servlet3web|#] > [#|2010-01-19T12:06:26.763-0600|INFO|glassfishv3.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=11;_ThreadName=Thread-1;|Loading > servlet3web Application done is 11375 ms|#] > > ------------------------------------------------------------------------------------------------------------------ > > Also attaching ...