jakarta-ee

Every time I make an Ajax request in JSF2 I am getting a new session bean,why?

时光总嘲笑我的痴心妄想 提交于 2020-01-11 09:56:26
问题 Hi I am getting a new session bean for every ajax request made to this Bean... Can any of you tell me why ? ...... imports ...... @Named(value = "userController") @SessionScoped public class UserController implements Serializable { private User current; private DataModel items = null; @EJB private br.com.cflex.itm.dataaccess.UserFacade ejbFacade; private PaginationHelper pagination; private int selectedItemIndex; public UserController() { } public Collection<Project> getMyProjectList(){

How to remove '.do' prefix from url in Struts1?

本小妞迷上赌 提交于 2020-01-11 09:51:58
问题 I have written a web-application in Struts 1 framework. Everything works fine but on form submission when user is forwarded to next page URL which is shown is actionname.do . I don't want this Struts 1 default suffix on URL. Instead of it I would like to see page's name in URL. How to do it? Note : I have tried editing servlet mapping in web.xml . Have replaced /*.do . But In that case even my index page doesn't open. 回答1: Open /WEB-INF/web.xml You will have to find the servlet-name of the

How to remove '.do' prefix from url in Struts1?

吃可爱长大的小学妹 提交于 2020-01-11 09:51:30
问题 I have written a web-application in Struts 1 framework. Everything works fine but on form submission when user is forwarded to next page URL which is shown is actionname.do . I don't want this Struts 1 default suffix on URL. Instead of it I would like to see page's name in URL. How to do it? Note : I have tried editing servlet mapping in web.xml . Have replaced /*.do . But In that case even my index page doesn't open. 回答1: Open /WEB-INF/web.xml You will have to find the servlet-name of the

JAX-RS failed to inject @EJB or @Inject

偶尔善良 提交于 2020-01-11 09:20:54
问题 I'm trying to test a minimal JAX-RS + EJB/CDI injection mechanism and currently hitting a road-block due to GlassFish unable to inject for whatever reason. (Using @Inject will throw NPE because GlassFish cannot inject the POJO). My beans.xml contains only <beans /> Here's my web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app 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

Deploying to a Tomcat server which is already running outside of IntelliJ IDEA

大憨熊 提交于 2020-01-11 08:37:14
问题 I have installed Tomcat server on my PC and I have added it as a service in Windows. So now it starts each time I boot my computer. Now, in IntelliJ I have configured an application server, and that is my Tomcat server, however when trying to "run" the application it says that the port is already in use....and it is ofcourse since Tomcat is started on boot. Is it possible that IntelliJ deploys to the already running Tomcat server instead of trying to start again? 回答1: If you want to deploy to

How to serve a file with JSP?

微笑、不失礼 提交于 2020-01-11 08:23:31
问题 This may sound totally stupid, but is a case of real life :( I'm able to display a HTML table with a "virtual" link name. Something like this: Xyz description <a href="docId=123">document.doc</a> Xyz description <a href="docId=456">documentB.doc</a> Xyz description <a href="docId=798">documentC.doc</a> This doc id represents an id in the database ( for these docs are stored in a blob as byte[] ) Anyway. I'm able to get that id, query the database and retrieve the byte[] ( and even store it in

How to serve a file with JSP?

邮差的信 提交于 2020-01-11 08:23:09
问题 This may sound totally stupid, but is a case of real life :( I'm able to display a HTML table with a "virtual" link name. Something like this: Xyz description <a href="docId=123">document.doc</a> Xyz description <a href="docId=456">documentB.doc</a> Xyz description <a href="docId=798">documentC.doc</a> This doc id represents an id in the database ( for these docs are stored in a blob as byte[] ) Anyway. I'm able to get that id, query the database and retrieve the byte[] ( and even store it in

Practical usecase based difference between JAX-RPC vs JAX-WS vs JAX-RS web services

你说的曾经没有我的故事 提交于 2020-01-10 15:40:31
问题 I know there are many documents available on net which mostly describes technical difference. But I'm rather interested to know what are the common use cases where you prefer one specific type over other any why ? Are those preferences because integration patterns/products support particular type ? 回答1: Thanks for answer. However practical use case difference and when to use what. Both, JAX-WS and JAX-RS have standard implementations. I have come up with the following differences: RESTful

Practical usecase based difference between JAX-RPC vs JAX-WS vs JAX-RS web services

穿精又带淫゛_ 提交于 2020-01-10 15:40:07
问题 I know there are many documents available on net which mostly describes technical difference. But I'm rather interested to know what are the common use cases where you prefer one specific type over other any why ? Are those preferences because integration patterns/products support particular type ? 回答1: Thanks for answer. However practical use case difference and when to use what. Both, JAX-WS and JAX-RS have standard implementations. I have come up with the following differences: RESTful

EJB 3 Session Bean Design for Simple CRUD

可紊 提交于 2020-01-10 08:38:36
问题 I am writing an application that's sole purpose in life is to do CRUD operations for maintaining records in database. There are relationships between some of the tables/entities. Most examples I've seen for creating session beans deals with complex business logic/operations that interact with many entities which I don't have. Since my application is so very basic, what would be the best design for the session bean(s)? I was thinking of having one session bean per entity which had CRUD the