Gaurav Dighe

Greenhorn
+ Follow
since Jun 25, 2009
Gaurav likes ...
Netbeans IDE Oracle Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gaurav Dighe

Hello All,

I installed Oracle 10g and Netbeans on my machine. I am not able to start the glassfish server. its giving be below error:

SEVERE: Shutting down v3 due to startup exception : Address already in use: bind: 8080=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@1016962

Please help me out. and please guide me what needs to be done.





11 years ago
Hi,
I have installed Oracle 10g in my Laptop.
Global Database Name: orcl
System Identifier(SID): orcl
UsrName: scott
Password: tiger

I have installed Netbeans 6.9 . i have added odbc14 in libraries of Netbeans and in Drivers of Netbeans. I have also created Environment variable for the same. Whn i am trying to establish new database connection using this Oracle thin Driver, i am getting error: Unable to add conection. Connection refused.

Driver Name: Oracle Thin(with SID)
host: localhost
port: 1521
SID: orcl
User Name: scott
Password: tiger




Please help...
Hi,
In Struts1 , ActionServlet was used as front controller but in Struts2 FilterDispatcher is used.
  • Can anyone tell me the difference?
  • Why front controller is changed in Struts2 to FilterDispatcher?
  • What was the backpoints of actionservlet that lead to usig FilterDispatcher as frontcontoller?


  • Awaiting for reply.
    11 years ago
    Hi Devaka,
    Below is the code
    e.g. If My stateful session bean "AuthenticateBean" contains below method and has remotel interface"AuthenticateBeanRemote" in the package ejb

    Login HTML Page contatins textbox name"txtUser" , Password Textbox named"txtPassword" and Submit Button. On clicking submit it will take us to authenticate.jsp
    I know according to MVC2 i should be using JSP Page for presentation purpose only.

    Now in JSP Page, I have imported javax.naming.*, javax.ejb.*, ejb.* below some code deomstration



    How to add object to the state of stateful session bean. can you give me a small code.

    Only web security is enough for such application or do i need to give EJB security also.
    Second thing if i want to check for authenticaion using JDBC Realm how to check it. EG if a new user (who has not logged in, clicks on Products Page, then he will be cheked whether he is logged in and then whether he is authorised to use that resource. Now in my case if user has not logged in, by clicking on Products page, Login page should be displayed with Register link. if he provides his authentication , then he should be directly allowed to view the product page.) How to establish this thing with JDBC Realm.
    Hi,
    I want to learns JCAPS and give examination on the same. As oracle have taken over sun microsystems, i dont know whether JCAPS is still availble or not.
    Does JCAPS certification still holds a good value for a fresher.

    Please help me out, from where i can download and learn and give exam for the same. If JCAPS is no longer available then is there any other certificate i should target which will give me a good salary as a fresher.

    11 years ago
    Sir Sorry, But actually i am new to EJB.
    How we can get, add to and remove from Stateful Session Bean State. Please elaborate with some code for my understanding.


    Sir,
    Both will be stateful. then state will be maintained.But how will be maintained if both are stateful.

    But if , i have statefulsessionbean for authentication and productbean for purchasing products. and my productbean is stateless, then how can i maintain the user integrity here ie.e session management here. whether it is possible or not?
    Hi paul,
    thanks for your answer.
    thats means: Stateful Sessionbean will take cared of evenrything maintaining the client state as long as user is logged in, maintaining the integrity of the user.

    But only doubt i have that whether client state will be maintained accross 2 EJB irespective of whether one of them is Stateful or not. If so then how does it maintains?

    Please reply back
    My knowledge of EJB Session bean say:
    1. Stateful Session Bean : Maintains the client state.
    2. Stateless Session Bean : Does not maintain the client state.
    Now I am developing Shopping Cart Example using EJB, Servlet, JSP and HTML pages.
    My Project contains following pages:
    1. login.html
    2. AuthenticateServlet.java
    3. User.jsp
    4. PurchaseServlet
    5. PurchaseSuccessful.jsp
    6. AuthenticateBean – Stateful Session Bean
    7. AutheticateBeanRemote – Remote Interface of Authenticate Bean
    8. PurchaseBean – StatefulSession Bean
    9. PurchaseBeanRemote -- Remote Interface of PurchaseBean

    Session Bean with its remote interface is maintained in the ejb package.
    Login.html contains;
    1. textbox named “txtUser”
    2. Password textbox named “txtPass”
    3. Submit Button
    On submitting the credentials, it will check for the authentication in the AuthenticateServlet.
    AuthenticateBean contains
    public boolean authenticate(String user, String pwd)
    {
    if(anylogic)
    return true;
    else
    return false;
    }
    The above method is exposed in AuthenticateBeanRemote Interface.
    2. AuthenticateServlet contains
    I have done lookup of AuthenticateBeanRemote and have created abr. Below some important code of AuthenticateServlet;
    String user = request.getParamter("txtUser") ;
    String pwd = request.getParamter("txtPassr") ;
    boolean flag = abr.authenticate(user,pwd);
    if(flag)
    // then it will direct the control to User Page
    else
    out.println("Failure");

    User.jsp page will show me the UserID and some task that the authenticated user can do.
    My question: is while redirecting the page to User.jsp from AuthenticateServlet, do I need to do URLRewritting to maintain the session or do I need to create separate HTTPSession Object or does the Stateful session bean will take care of session management on its own. i.e. no need to do anything, just transfer or redirect to User.jsp page .
    User.jsp has purchase catalog of which the user will select products and click on purchase. On clicking purchase, it will take us to PurchaseServlet.
    My question Now in the PurchaseServlet if I have written the code to access the methods in PurchaseBean, Whether it will be a guarantee that the authernticated and currently logged in user is accessing the methods so that only that person’s purchased items are visible and no mishap will occur regarding the user integrity.
    PurchaseBean only contains the method to add the amount.

    My Question: if at the same time 2-3 users are logging in the application, then whether by using the statefulsession bean, user integrity is maintained. OR do I need to use some other approach.
    Please help me... I know these questions are silly but that’s the way the technology can be learned.

    Hi Devaka,

    Thanks for the reply.
    About the first one, you mentioned only to do JNDI Lookup right?
    e.g. If My stateful session bean "AuthenticateBean" contains below method and has remotel interface"AuthenticateBeanRemote" in the package ejb
    public boolean authenticate(String user, String password)
    {
    if(someLogic)
    return true;
    else
    return false;
    }

    Login HTML Page contatins textbox name"txtUser" , Password Textbox named"txtPassword" and Submit Button. On clicking submit it will take us to authenticate.jsp

    Now in JSP Page, I have imported javax.naming.*, javax.ejb.*, ejb.* below some code deomstration
    <%! private AuthentiateBeanRemote abr;
    public void jspInit()
    {
    try
    {
    Context ctx = new InitialContext();
    abr = (AuthenticateBeanRemote)ctx.lookup("java:comp/env/ejb/Autheticate");
    }
    catch(Exceptione e)
    {
    e.printStackTrace();
    }
    }
    %>

    some html codes followed by
    <%
    String user = request.getParameter("txtUser");
    String pwd = request.getParameter("txtPasswordr");

    boolean flag;
    flaf = abr.authenticate(user,pwd);
    if(flag)
    {
    %>
    "SUCCESS"
    <% <--tell me how to get sessionID here(SessionID) because that will be used in further interaction such as buying product, payement etc....so that we can make sure that a logged in user is only accessing these things or else the container itself takes cares of these things...Means no need to supply session related things as container will take care......I hope you are getting what i am saying -->
    }
    else
    {
    %>
    FAILURE
    <%}%>


    If there are more than 2 users logging at the same time. then does statefull session bean solve the prupose of securing the identity of the user logged in. or should go with different EJB approach. Please help.

    Thanks for the solution to the second doubt

    for the third....if i am developing application as above mentioned in the 1st doubt...then i need to give websecurity only and no need to give ejb security.


    I know that i am asking some silly doubts..but yes i want to learns these things and have not joined any trainings.

    Hi,
    I have below doubts:
    1.What I did not understand is, Stateful Session Bean helps to maintain the client state of an application. Does it mean that session is maintained for the user? If so, how do we retrieve the session id from the Stateful Session Bean in a JSP page? Whats is the difference between Sessions used in Web through HttpSession and Stateful Session Bean. which one are more useful and why?
    If session is not maintained then can anyone explain be the concept of session bean or an article with well explained example for Shopping cart with User authentication.

    2.Can the user authentication and the session can be maintained using JDBC Realm. If so please explain me that also with a nice example or an article explaining the concepts with an example.

    3.What is the difference between EJB security and Web Security? Please provide me the article with a good examples.
    For EJB 3, follow:
    1. Java EE 5 or Java EE6 Tutorial available on download.oracle.com/javaee/6/tutorial/doc/
    2. EJB3 In Action.

    But first better go through tutorial. It will help you understand basic concepts and also its original tutorial available. then go for EJB3 in action.



    Hello All,

    I am developing shopping cart application with EJB. the application will be web based .ie. servlet jsp will be used with EJB.
    i have JavaDB. I have table named "Users". Table has 2 columns 1. user and 2. password.

    When the application is started, home.jsp will be displayed.

    The Home page(home.jsp) of my application contains:
    1. Login form with login Button and Register link.
    The user will provide his credentials. His credentials will be checked against the JAVA DB Users table. If correct then a user page will appear to him showing his account details and other things: Products List etc,,,,,
    If he is new user and want to register himself then, user will click on register link. Then registration Page will appear in front him and then he will register himself and his data will be saved in database.

    2. Products Link: any body clicking on the products will be migrated to the products page. the list will appear. if he wants to purchase some items, he will check the checkboxes and will click on submit button. If the user has not logged in then, the login form with register link will appear. Once he enter his credentials, his credentials will be checked against the JAVA DB Users table. if correct , then his selected products will be viewd to him and session id will be tracked which will be used for further transactions.

    This thing have been easily achieved using Servlet,JSp and JDBC.

    Now if i want to use JDBC Realm(Security), then how to configure my glassfish server for such things.
    Requirements are:
    1. Checking Credentials using JDBC Realm
    2. Registering new user and data to be stored in Database User table using JDBC Realm
    3. if credentials are correct, then mainatin the session and that sessionid will be used for further transactions.

    PLease help me with codes or any configuration codes.
    Hello All,

    I am developing shopping cart application with EJB. the application will be web based .ie. servlet jsp will be used with EJB.
    i have JavaDB. I have table named "Users". Table has 2 columns 1. user and 2. password.

    When the application is started, home.jsp will be displayed.

    The Home page(home.jsp) of my application contains:
    1. Login form with login Button and Register link.
    The user will provide his credentials. His credentials will be checked against the JAVA DB Users table. If correct then a user page will appear to him showing his account details and other things: Products List etc,,,,,
    If he is new user and want to register himself then, user will click on register link. Then registration Page will appear in front him and then he will register himself and his data will be saved in database.

    2. Products Link: any body clicking on the products will be migrated to the products page. the list will appear. if he wants to purchase some items, he will check the checkboxes and will click on submit button. If the user has not logged in then, the login form with register link will appear. Once he enter his credentials, his credentials will be checked against the JAVA DB Users table. if correct , then his selected products will be viewd to him and session id will be tracked which will be used for further transactions.

    This thing have been easily achieved using Servlet,JSp and JDBC.

    Now if i want to use JDBC Realm(Security), then how to configure my glassfish server for such things.
    Requirements are:
    1. Checking Credentials using JDBC Realm
    2. Registering new user and data to be stored in Database User table using JDBC Realm
    3. if credentials are correct, then mainatin the session and that sessionid will be used for further transactions.

    PLease help me with codes or any configuration codes.

    [moderator edit: show that it is about Glassfish]
    11 years ago
    Hi i am completely new to JSF. I want to learn JSf. Can anybody please suggest me a good book on JSF2 which should be easy to understand for a beginner . The books should be self explanatory and should cover examples.

    Regards, Gaurav Dighe
    11 years ago
    JSF