Win a copy of Spring Boot in Practice this week in the Spring forum!

Moses Marfo

+ Follow
since May 24, 2009
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Moses Marfo

I am unable use apache axis 2 to generate client side classes from the endpoint using apache axis 2. I have tried the following without any success

  • Downloading the wsdl file and using a local copy instead of accessing it via the web.
  • Downloading the schema files separately and including them in the wsdl
  • Using wsimport instead of apache axis 2

  • Below is the error that i am getting

    I will appreciate any help that I can get.
    8 years ago

    Is this statement true? I read it in EJB3 in action(page 201, section 6.3.4)
    If you are using a stateful session bean and need to maintain a transaction across method calls, BMT is your only option.

    I was under the impression that CMT could do this too.

    Below is an example from MZ notes showing the order of invocation of entity lifecycle callback methods.
    Can somebody please explain why the method "postPersistAnimal" is invoked last instead of first. I thought it would be called
    first since class Pet extends Animal.


    CASE 1: If a @PostPersist event occurs on an instance of Cat, the following methods are called
    in order:
    1 postPersistPetListenerMethod
    2 postPersistCatListenerMethod
    3 postPersistCatListener2Method
    4 postPersistAnimal

    Entity A reference Entity B and the Fetch type for B is LAZY.

    The question is will I be able to access entity B(A.getB()) on the client side where entity A is detached from the persistent context
    or I have to set the fetch type to EAGER to do this?
    The program is an event audit report which allows event records retrieved from database to be sorted based on entered creteria.
    The Object that I'm using to store the retrieved records consist of more than just location and event date, there is also user name and event description
    The List of records consist of two lists obtained from database using two separate queries. The number of records in the list can range from 0 - 1000 or more.
    The list is not updated once retrieved from the database, it is just for display purposes. I hope that is sufficient information.
    12 years ago
    thanks Rob for the solution
    the list is being sorted properly now

    Jim ........can you please expound on the alternative solution
    12 years ago
    I will like to sort an object having two instance variables(location and event date).

    Location can be blank. I will like all objects with blank locations to appear at the top of the list, sorted by event date.

    How do I do this?

    What I did was implemet Comparator and pass it to "Collections.sort" along with the list. I was able to get records without value for location to appear at the top
    by returning 1 from the compare method if either object being compare has a blank location but I'm unable to sort the blank location records by event date.

    Below is the compare method
    12 years ago

    David Newton wrote:No, Struts 1 does not handle all incoming requests--only the ones the action servlet is mapped to.

    Look at the generated HTML.

    Thanks David
    I looked at the generated HTML. The container does append ".do" to the action attribute value of the form element before serving the page to the client.
    12 years ago

    From reading head first JSP and servlet my understanding of request handling is that when a request comes in the container finds the URL pattern that best matches it and uses that to determine which servlet to invoke to handle the request.

    Currently I have the following web.xml, struct-config file and login page

    Struts-config file

    login Page

    The value of my action attribute for my login page is "/login" doesn't have an extension of "do" but the container is still able to use the struts-config file to invoke my actionform class to do the validation when I submit the page.

    How is this possible and there is no matching url pattern of "/login" in my web.xml file?

    I will like to know whether all incoming requests are intercepted by the Struts servlet controller regardless of the specified value of the
    action attribute in the form and that one just has to ensure that the request path is specified in the action element of the struts-config file

    12 years ago
    I took out the realm name from "<login-config>" and it is still not working.
    Can someone please help me figure out what is wrong with the configuration below
    I keep getting "HTTP Status 403 - Access to the requested resource has been denied" when I run the application.

    I'm using netbeans 6.7.1 with tomcat.

    this is my web.xml

    this is my tomcat-users.xml file

    I was expecting a log in screen to pop up when ever the application is run.

    All 3 files index.jsp, index.html and loginerror.html are outside the WEB-INF directory


    I just finished reading the chapter on Web App Security in HFSJ.

    I will like to know whether new J2EE project actually do specify/use "<security-constraint>" in web.xml file or there are better and newer ways of achieving authentication and authorization.Listing all users and roles in "tomcat-users.xml" seems a bit tacky to me a better approach to me will be to use a database to store users and roles.

    Will specify my users and roles in a database make most of the work(authentication and authorization) done by the container using "<security-constraint>" unnecessary?

    It seems like the only important tag I may use if I'm to define my users and roles in a database will be "<user-data-constraint>", someone correct me if I'm wrong.

    When I use a <login-config> is the user name and password compared with what is in tomcat-users.xml by the container or I have to retrieve these two parameters and do the comparison myself.
    O.k I get it now thanks.
    Initially I was trying ${} due to the statement ("target" must evaluate to the OBJECT, you don't type in the string "id" name of the bean or Map attribute".) in the HFJS, then I tried ${} and it started to work, from then I got confused based on the statement made in the book.

    Thanks for the help. I will be grateful if you can provide an example where "target" must evaluate to the OBJECT when using a Map.