Vikas Parikh

Greenhorn
+ Follow
since Aug 29, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vikas Parikh

Hello,

I have been working with JPA from past few months.
Recently, I am involved in writing EJB3 statless bean, Interceptor & JPA.

Before manager's (statless bean's) method gets invoked, I am intercepting it through interceptor.

In my manager method, I am annotating some arguments (entities) as
a custom annotation.

In my interceptor, i need to check if that argument (entity) exists in Data Base or not.

For normal entites, i know, i can perform it like this:



But , I have more than 100 methods spread across some 10 - 15 managers ( with 30- 40 entities ) !
& I feel this will surely be a cross cutting concern ...


I have decided to go like this :



In My interceptor though, I get only
and i need to check if that object (which is actually entity) actually exists in a data base or not




Hope I am clear with my requirement ...

My questions are following: Is there a way in JPA API,

1) To check if the is an entity or not

2) To fetch the primary key dynamically from as

3) If above 2 do not exist, a way to check if entity exists in DB, in some other manner, which solves my requirement

Thanks a lottt

Thanks in advance .....

Waiting for your valuable response ...

Regds,

Vikas
Hello,

Currently i am working on Struts 2 based application, in which i need to populate an array of Java beans from the form.

The problem, I am facing is:
Struts 2 is not instantiate an array of beans

I have gone through the Data transfer and Type Conversion of struts of 1.2, but every where I can see only following:
  • An array of primitive data types
  • List of primitive / Java bean
  • Map of primitive / Java bean


  • but i can't see the docs on An array of Java Beans.

    What I can't do in my application is:
  • Can not convert an array of beans into java.util.List<beans>
  • Can not instantiate the bean array (As the number of elements will be decided by the front end - form)


  • Please have a look at my configuration file:

    struts.xml:



    test.xml:



    Controller.java:



    Contact.java:



    input.jsp:



    output.jsp: Not concerned right now

    Exception got in the logs after submitting the form:



    Please give me suggestions to move forward

    Thanks in advance

    Vikas
    16 years ago
    Hello,

    I have developed a web service using AXIS2 as my web service engine.

    I have used POJO feature of AXIS2, so that if i have to migrate from AXIS2 to another engine (surely its gonna migrate to BEA Web Logic),
    it can be done, without much effort (Only configuration file needs to be changed).

    One of the problem, I am facing is, for reading the attachment.


    The AXIS2 sample code is as follows:



    This uses the API of AXIS2, for reading the attachment.

    Surely this would be an obstacle for switching to another engine.

    Is there any API, where by i can read attachments in engine neutralize
    manner ??

    Thanks in advance.

    Vikas
    16 years ago
    Just yesterdae, i had requested for logo again
    (Around one month after appearing for exam)

    & got the reply from Sun Cert Logo.

    I have downloaded it successfully ...

    This shows that Sun requires around 30 daes to get their certification
    database to upadte

    Thanks all of you for your kind response
    I have inquired abt this from the center, where i had appeared for the exam.

    According to them, Sun data center needs at least 15 daes to reflect the record.

    For my case, when i had requested for logo, it was hardly 5 ...

    It will be a nice idea to request after a month or so

    Vikas
    hello,

    Will add my prparation details in Sun Certification Results Forum.

    I have finally recived a mail from SunCertLogo@sun.com

    To say the least, it has shocked me

    it says following:


    Your request to use the Sun Certified Web Component Developer Logo logo has been denied for the following reason(s):

    Our database does not show that you have passed the Web Component Developer exam, so we have denied your request for the logo.


    How do i check, whether my certification details exist in Sun Database ??

    Prometric center from where i had given exam has nothing to say.

    Is there any minimum time period, after which only, one can request for logo ?? coz it has been only 14 daes for me ..


    Vikas Parikh
    Difference between these two patterns are easily understandable by following example, given by Hanumant Deshmukh in SCWCD Stydy Kit.

    Filter:

    This is like a Security Guard, which checks each and every person wanting to enter the facility

    Front Controller:

    This is like a beautiful (Adjective is mine ) Receptionist, in the facility to give the required information and directs the person to necessary place
    YES, Order Matters ...

    Your web.xml has one schama & it validates against that.
    There is no such restriction imposed at all.

    Please execute it your self and check that out.
    yep .. you are correct



    AND



    will produce the same.

    One of the reason, which i am aware of, why are there two ways of doing same is as below:

    Many times, one want to have Script less JSP Pages/ documents.
    In such scenario, one can not use scriptlets in JSP.
    So you can not invoke method through JSP. So in that situation Standard JSP action is provided as <jsp:include .. />

    Fortunately, it is provided as JSPs standard action, otherwise one need to have Custom Tag to include another resource, just as to print or set the attributes, we have apache's JSTL reference implementation.

    BTW, there is yet another way to include resource, if you want to explore

    <c:import ..>

    It has many more features than just including ..

    Vikas
    Its element name & everything are same as before, meaning

    <taglib>
    <taglib-uri> </taglib-uri>
    <taglib-location> </taglib-location>
    </taglib>

    the only thing is that its position has been changed from directly under web-app to web-app/jsp-config, meaning

    <web-app>

    .
    .

    <jsp-config>

    .
    .

    <taglib>
    <taglib-uri> </taglib-uri>
    <taglib-location> </taglib-location>
    </taglib>

    .
    .

    </jsp-config>

    .
    .

    </web-app>



    Vikas Parikh
    Definitely ..

    One can do any thing that he/she wishes from pageContext.

    That is the reason why PageContext is accessible with in the Tag Handler.

    You may get different information from PageContext like:

    1) ServletRequest: pageContext.getRequest();
    2) ServletResponse: pageContext.getResponse();
    3) Config: pageContext.getServletConfig();
    4) Application: pageContext.getServletContext();
    5) Session: pageContext.getSession();
    6) Exception: pageContext.getException();
    7) Page: pageContext.getPage();
    8) Out: pageContext.getOut();

    Basically one can access all the 9 implicit objects through Tag Handler

    In this case, to the best of my knowledge, output would be

    Hello, How are you ?

    Vikas Parikh