rammie singh

Ranch Hand
+ Follow
since Mar 26, 2009
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by rammie singh

Hi ,

I am getting following error when i am trying to deploy an application on Websphere Application Server Liberty.



Can any one please help me with this error and how it can be resolved.
Same application was running fine on Tomcat and then i decided to use Websphere Application Server Liberty. For this i created a new workspace in eclipse and then imported same folder structure of application from my old workspace to new workspace. In my old workspace the application was running on Tomcat. In new workspace i configured new target runtime to get  Websphere Application Server Liberty. I added few external jars like jsp-api.jar and servlet-api.jar and slf4j-log4j12-1.7.21.jar. Then i started the WAS Liberty server ran the application and was able to get application login page. But as soon as i entered login and password, i got the above error.  Please help

1 year ago
Hi Tsang,
First of all thanks for your reply. I can really understand now the concept of tag <spring: message >
however i still have one doubt related to it and just wanted to confirm

In my index page, will the <spring:message> tag will ever be executed? Will the value of variable "title.welcomeMsg" from required properties file be displayed here?
(i guess no, because before coming to this line, control of flow is being passed on to controller for the link "login/directLogin.htm" and flow goes to loginPage.jsp
page from the controller.Also i am not getting value of variable "title.welcomeMsg" getting displayed on loginPage.jsp page). I am just trying to understand the
purpose of putting on index.jsp.


2nd

Regarding <Context-Param> tag,
I dont see this tag used for every spring application. Say for example in hello world example HelloWorldInSpring

So when you say "this tag is used to tell the web-app where to load Spring configuration", does not it gets loaded in hello world example above?
So basically just wanted to understand what is the difference when we use and don't use tag with
is there some default loading/picking when we dont mention this ?
1 year ago
Hi,

I am trying to follow an already build spring application. I have an index page in my spring application which is as following

index.jsp



My web.xml file is



Now i have two question here

(1) When application is run, spring container will hit index.jsp which is configured as welcome page here and will load it. On index.jsp, it will execute the line

and then since it is a sendRedirect , it will search for this URL in controller class and do the processing as per logic of corresponding controller section.
My question is why we have written

in index.jsp. what is its output. Will it ever get executed? because moment it finds sendRedirect() function in index.jsp, the flow will go to controller class and will execute according to logic written there. Here, from controller class it gets redirected to actual login page without doing anything.




(2) My second question is what is <context_param> tag in web.xml file mentioned above and what is contextConfigLocation as its <param-name> and what is its use. Please explain in simple language so that i may understand it. probably with an example. Thanks. I tried to google it but almost everywhere it was high technical language rather than simple understandable one. Thanks.
1 year ago
I have a String array as

String finalArray[] = {"1", "a", "abc", "0.5", "1edfc"}

What is the best way to split the finalArray into two array

String s1[] = {"1", "0.5", "1edfc"} // should contain all strings who have number in it

String s2[] = {"a", "abc"} // should contain all strings who have all characters including special characters if any in it
2 years ago
Hi,

I want to develop a tool in java which periodically scans a file hierarchy and stores any changes which has happened in the file. This is an assignment given to us.
Following are the features this tool can provide

The tool allows the user to:
  • Build a history of all the files that have changed since the last time a scan was done
  • designate a snapshot as a FileSet - there should be the ability to sign FileSets and mark them as restore points or reference FileSets
  • allows me to compare the current scan with a FileSet to see what deltas exist
  • each file is signatured - using a hash algorithm (like MD5)
  • a copy of the file should be stored for future retrieval
  • each file should have a file_key that identifies it (except for zero length files or device files in UNIX - which will have to be treated specially)
  • each file that is stored should be encryptable so that it is not modifiable - this allows for repudiation and file validation



  • I tried searching a similar tool with sourcecode for reference but did not find one.
    If any one can please guide if there is similar tool available and whose code can be referenced.Thanks.
    Sorry if i have posted in wrong section. I was not sure where to exactly paste this query.
    2 years ago
    Sorry ..it just got replicated.
    6 years ago
    JSP
    hi i am trying a piece of JSP code but i am not getting the required result. Can you help me please

    When i am trying with the code below, it is showing the result, but text box and password box are missing. i have also attached the screenshot for this.




    but the book which i am following, in that the .jsp page has coding like





    but this code gives error and does not compile.


    pease tell me what is the correct way of doing it ?


    Also my struts-config file is like this




    and my RegisterForm.java class is like







    and my RegisterAction.java class is like this





    now my question is .. from .jsp page, where i put the username and password1 and passwrd2 ..the RegisterForm is called and it's object is created ..but how does the RegisterForm claas knows which value from jsp page will go and get set into which RegisterForm class variable ?

    because no where something like this is used

    String username = request.getParameter("username");

    what i mean here is ..without fetching the value of variables like username and password1 and password2, from JSP page how come these values are set to repective variables in RegisterForm class object.
    6 years ago
    JSP
    hi i am trying a piece of JSP code but i am not getting the required result. Can you help me please

    When i am trying with the code below, it is showing the result, but text box and password box are missing. i have also attached the screenshot for this.




    but the book which i am following, in that the .jsp page has coding like





    but this code gives error and does not compile.


    pease tell me what is the correct way of doing it ?


    Also my struts-config file is like this




    and my RegisterForm.java class is like







    and my RegisterAction.java class is like this





    now my question is .. from .jsp page, where i put the username and password1 and passwrd2 ..the RegisterForm is called and it's object is created ..but how does the RegisterForm claas knows which value from jsp page will go and get set into which RegisterForm class variable ?
    6 years ago
    Ok. So it means that with every call of frame.setVisible(true) method, paintComponent() method is called. right ?


    And if it is called, then since the paintComponent() method here, which is overridden, is associated with panel , should be called only when it is panel's turn to call painComponent() method.

    For frame, shouldnot it be that the default paintComponent() method is called rather than overridden one ?

    Just asked this question, because of curiousity.
    6 years ago
    ok, i got this working.

    here is the code i used




    but i have couple of questions.
    I am following "Head first Java" book.

    it says that when a repaint() method is called , it calls paintComponent() method for every widget added to the frame.

    My questions are
    (1) is it not a overhead when a repaint() method is called , it calls paintComponent() method for every widget added to the frame. Although it is clear here that only Panel(here drawPanel) widget has provision of paintComponent() method being called and the button widget added to the frame here can not call paintComponent() method.

    (2) My second question is .. when i executed this programme, how come at the first go itself the panel having colured oval is shown. where this should come only when the "Change Colour" button is clicked that is when an event ocurs then only the actioPerformed function is called and then repaint() function is called on the frame.


    i hope i am clear to you guys ?
    6 years ago
    hi
    i am executing this prograame and it is executing also. but when i click the "Change colour" button, the progrrame is not showing the colured Oval.
    can any body please tell me where i am going wrong ?



    i have also attached the screen shot of the output.
    6 years ago
    Thanks everybody.

    The problem indeed was in selecting the format. i tried ("dd/MM/yyyy") and it is working.

    6 years ago
    Hi all,

    How can we increase the date in java as whole. I mean to say that suppose my current date is 30/09/2011 then after increasing the date by 1 it should directly give 1/10/2011 not 31/09/2011 or if i increase by 2 it should give 02/10/2011 not 01/09/2011.
    what i am trying is below. Is there any functions where month or year are automatically taken care off after increasing.



    can any body please help me.
    6 years ago
    HI,

    i m trying a piece of code to give background colour to a cell by using POI. But result is not getting reflected..meaning the bckground color is not produced.

    Can any body please help me ..or tell me, where i am going wrong.

    my piece of code is below