jakarta-ee

ClickJacking Filter to add X-FRAME-OPTIONS in response

社会主义新天地 提交于 2020-02-03 04:50:07
问题 In order to tackle clickJacking and blocking my site to be opened by iframe I have created a servlet filter in which I am adding below line to add "X-FRAME-OPTIONS" response header. But when I run page and see response headers of that page I never get this header in there. Any Idea why? public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException { HttpServletResponse res = (HttpServletResponse)response; chain.doFilter

<url-pattern> in filter mapping is not valid

这一生的挚爱 提交于 2020-02-02 11:57:46
问题 I have a @POST rest method and i want to make filter for it, so only the person who is logged in in the application to be able to have access to it. Here is my @POST method : @POST @Path("/buy") public Response buyTicket(@QueryParam("projectionId") String projectionId, @QueryParam("place") String place){ Projection projection = projectionDAO.findById(Long.parseLong(projectionId)); if(projection != null){ System.out.println(projection.getMovieTitle()); System.out.println(place); projectionDAO

Cannot load group for JDBC realm

孤街醉人 提交于 2020-02-02 11:20:45
问题 Im being a few days struggling to create my first Security realm in glassfish V3. My problem is that it looks like for some reason, the application does not see the one of the coulmns in the database, and my console keeps telling me that there is a syntax error. I think the table that is making me trouble is the join column(Below you will see my DB implementation). Here i will copy the hold stack trace so you will see what is going on: FINE: [Web-Security] Setting Policy Context ID: old =

Java-EE6: FetchType.LAZY with static weaving throws strange exception

与世无争的帅哥 提交于 2020-02-02 08:51:19
问题 My Solution consists of 3 different projects: EJB project with Netbeans auto-generated Facades to manage Entity classes and the persistence.xml Class-Library that holds all @Entity annotated and statically weaved database classes and the remote interfaces for the facade ejb's (shared between EJB and stand-alone client) Stand-alone Client that consists mainly of Swing GUI classes I use Glassfish 3.1.2, Eclipselink 2.3 as JPA-provider, Netbeans 7.1.1 and a MySQL database. I configured an Ant

Java-EE6: FetchType.LAZY with static weaving throws strange exception

杀马特。学长 韩版系。学妹 提交于 2020-02-02 08:49:06
问题 My Solution consists of 3 different projects: EJB project with Netbeans auto-generated Facades to manage Entity classes and the persistence.xml Class-Library that holds all @Entity annotated and statically weaved database classes and the remote interfaces for the facade ejb's (shared between EJB and stand-alone client) Stand-alone Client that consists mainly of Swing GUI classes I use Glassfish 3.1.2, Eclipselink 2.3 as JPA-provider, Netbeans 7.1.1 and a MySQL database. I configured an Ant

Any best practices for dealing with Java EE and java.endorsed.dirs?

非 Y 不嫁゛ 提交于 2020-02-01 03:12:41
问题 I've recently run into a problem with glassfish standalone (v3.1) vs glassfish embedded (v3.1) vs java SE and the way java.endorsed.dirs is used. The specific problem I had is here, but I don't think it's the last time I'm going to run into something similar. The information I found here and here suggests adding the glassfish endorsed libs to the bootstrap classpath when compiling. However, this bug report suggests it is difficult to get the endorsed libs set correctly when using glassfish

Best way to interact with EJBs in Java EE

吃可爱长大的小学妹 提交于 2020-01-31 18:34:20
问题 I have a moderate sized Java EE 6 project that uses several EJBs, including one which sole purpose is managing database calls through JPA. My question is what is the best way to add a new class that does some random bit of functionality and then calls the database access EJB to persist the data from this class. Does this new class have to be an EJB if it needs access to annotations and injections? Does it have to be an EJB if it has to be deployed with the rest of the project? I was told that

JSP Processing instruction not closed

我是研究僧i 提交于 2020-01-31 07:11:47
问题 I tried to include an HTML file to my JSP but I eclipse show'd this error The included file <%@include file="includes/head.html" %> And the error Processing instruction not closed And this is just the simple JSP <%@include file = "includes/head.html" %> <form action = "#" method = "POST"> Username: <input type = "text" name = "username"><br/> Password: <input type = "password" name = "password"><br/> </form> </body> </html> 回答1: Select All, Backspace,Then ctrl+z to revert. works for me. But

JSP Processing instruction not closed

旧城冷巷雨未停 提交于 2020-01-31 07:09:45
问题 I tried to include an HTML file to my JSP but I eclipse show'd this error The included file <%@include file="includes/head.html" %> And the error Processing instruction not closed And this is just the simple JSP <%@include file = "includes/head.html" %> <form action = "#" method = "POST"> Username: <input type = "text" name = "username"><br/> Password: <input type = "password" name = "password"><br/> </form> </body> </html> 回答1: Select All, Backspace,Then ctrl+z to revert. works for me. But

JSP Processing instruction not closed

隐身守侯 提交于 2020-01-31 07:09:39
问题 I tried to include an HTML file to my JSP but I eclipse show'd this error The included file <%@include file="includes/head.html" %> And the error Processing instruction not closed And this is just the simple JSP <%@include file = "includes/head.html" %> <form action = "#" method = "POST"> Username: <input type = "text" name = "username"><br/> Password: <input type = "password" name = "password"><br/> </form> </body> </html> 回答1: Select All, Backspace,Then ctrl+z to revert. works for me. But