Im reading struts 2 in action and trying to model my login / authentication after the portfolio login presented in the book. Unfortunately while the book uses mysql the web site I am working off of is using web services to retrieve information.
I basically have 3 questions.
1. Is javax.persistence appropriate for web services and preserving entity data or should I be using something else?
2. In struts 2.1.8 does anyone know which jar the javax is in? I am looking at Struts2InAction.war and there are no javax jars so it must be in another jar. I have tried adding spring.jar and Struts2-oval-plugin-22.214.171.124.jar to my project and I still get the dreaded "import javax.persistence cannot be resolved"
3. Im afraid I dont understand why carrying around say 4 variables in a session per user will have any less over head than having a pojo object carried around for each user. What is the advantage?
I'm reading the same book, although I don't think I'm as far as you are yet.
AFAIK (and I'm willing to be corrected here), javax.persistence is for the Java Persistence API - this is the API that can be used for storing entities in a Database. It's an API that has been derived for providers to then supply implementations to (e.g. Hibernate or TopLinks), and you can use it to get a consistent API regardless of the provider, for storing your Entities in a database.
However, if you are using WebServices, then this is the wrong API. Perhaps something like AXIS2/JAX-RPC/JAX-WS might be more useful if you are trying to get information from WebServices instead?