Rajani Gummadi

Ranch Hand
+ Follow
since Dec 17, 2010
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 Rajani Gummadi

Thanks Bear,

I do agree that protecting css is not adding any value, as hardly any body would care. But coming to javascript, what do you mean by packing and how do we do that ?
6 years ago
Hello All,

I started a small sturts based application and was using a css file. Though tutorial, mentioned to keep the css file at application level, I experimented putting it under WEB-INF, though I was skeptical. As expected, css file is not accessible as browser would not be served those restricted files by the container. But that leaves me a question, on how to protect css or js files which are used by browser, if I can not keep them in WEB-INF. Keeping the point of protecting those resources aside, but how to do that, if we have to ? Can some body explain me this ?

6 years ago
I'm not sure, if the below solution works for your case, but if you need to have a variable being set in javascript to be available across your navigation, another approach would be to set in session, instead of relying on request scope. This way, whether you use redirect or forward, as long as you are in that session, the value should be accessible.

What I meant here is, suppose

// The code below is just a flow and requires some syntax fixes and optimization


What you are doing here is extracting the request parameter and assigning it as an attribute of a session. After this, if you do either redirect or forward, the value should be available, though out the session and if you keep it in application scope, it is accessible through the application . But if you chose to set this in request scope, and need to have the value available through out the navigation for HTTP redirects, you need to explicitly set to request scope before each invocation.

Though I have used jsp for page navigation control, it should have been implemented ideally by some sort of page controllers (servlets), but the idea remains the same.
7 years ago
Hi Prexa,

As far as I understood your problem (I'm not familiar with ajax, so my question/answer does not refer using it), you want to send some parameters that are being set in a javascript from admin.jsp to result.jsp through search.jsp. Irrespective of whether you use ajax or not, if you are using redirect, the unless you set the value again in search.jsp before sent to result.jsp, the request parameters that are set in admin.jsp would not be preserved through out the navigation (because of redirection - HTTP 3xx). So, if you are employing HTTP redirect, then you need to explicitly set the value in request before sent to result.jsp. But if you are using forward, then its a different case, in that the values which is set in admin.jsp would be preserved through out the path.

I'm not sure, if this is what you are looking for, but its just my thought on this problem.

7 years ago
First of all, I apologize to dig this old thread out, but I thought this would be the best continuation as my problem is exactly the same as the subject line says.

Secondly, I never used HSQLDB before and I installed it, set up my settings

Type : HSQL Database Engine Standalone
Driver : org.hsqldb.jdbcDriver
URL : jdbc:hsqldb:file:MyDB
User : SA
Password : <<Null>> //No password

I created a table called Employee under schema PUBLIC and from the script I see the following statements

From HSQLDB, when I did select, it worked and retrieved me a record (1,ABC,ITG,5000)

So I thought the table creation is fine and then moved onto write a sample JDBC app to retrieve the record

As you see, it is a very simple program to retrieve the records. But upon running, it is failing at ResultSet rs = s.executeQuery("SELECT * FROM PUBLIC.EMPLOYEE"); with the exception

Is my query in extracting records wrong ? or is that because of the statement in .script file


which may necessarily mean that the table is created in memory, but not accessible from another process like external java application but on same jvm.
Hi All,

I'm using GlassFish V3.0 and working on a very simple stateless session bean example and I my ejb-jar.xml is as follows

In my stand alone client, I tried to lookup for the home as below

I did not setup properties for JNDI server and port as this link, does say "its not required".

I have the interfaces of the package org.ejb.session.interfaces, jar'ed and added to my client class path and also have gf-client.jar in the classpath, again as mentioned in the above link.

My above setup did not work, and returned me javax.naming.NamingException (caused by Caused by: javax.naming.NameNotFoundException: HelloWorld not found).

Then I did asadmin list-jndi-entries from my glassfish installation and found that the JNDI name is actually org.ejb.session.interfaces.HelloWorldHome. So I changed my lookup to use the above reference and it worked.

My question here is, I thought ejb-name in deployment descriptor would be used in JNDI lookup. Did I miss any other file? I knew that, I did not use any container specific configuration file, but I thought GlassFish provides one by default. So is the default setting of GlassFish is to use the entire home object including the package.

Hi All,

I'm trying to parse a String like A|B|C|D||||| as follows

My expectation is as follows

Token = A
Token = B
Token = C
Token = D
Token =
Token =

But I get only first 4, obviously the last 2 are not considered or ignored... I knew that my regular expression is wrong, but could not figure out the solution on how to have the emply strings surrounded by "|" is also retrieved..

Can some body help me in this ?

7 years ago

Mikalai Zaikin wrote:

  • [list]You can notice difference if you compare RPS style with bare document style. In this case document style won't have operation name in SOAP message.

  • Thanks Mikalai,

    What is RPS style. Is this same as RPC. For testing this RPS with Bare, I need to have only one parameter for the method call. Am I right?
    Thanks Ivan,

    From SOAPUI, the SOAP request is

    I did not get any response for this, as I believe, due to the run time exception

    [com.sun.istack.XMLStreamException2: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.example.org/Calculator/", local:"addNumbers"). Expected elements are <{http://www.example.org/Calculator}addRequest>,<{http://www.example.org/Calculator}addResponse>]

    But I have not hardcoded the request and response and SOAPUI generated the request based on WSDL. Do I need to fix anything in my WSDL for this to get to work ?
    Hi All,

    I have my class defined as

    For this the SOAP request and SOAP Response taken from Glassfish testing facility is as follows

    I repeated the test by changing the style to RPC in @SOAPBinding annotation and the when I looked into SOAP request and response, they look exactly the same as above.

    In such case, is it actually possible to determine the style being used by looking solely at SOAP request/response. I have this question as I actually saw a similar question in one of the mock tests.

    How to determine, if a SOAP request and response belongs to RPC or Document style, when WSDL or @SOAPBinding annotation is not given in a question ?

    I have my xsd and wsdl as defined below



    as seen above, I'm using RPC Literal type style.

    I ran the xjc against the schema and classes AddRequestType.java AddResponseType.java are created along with ObjectFactory.java and package-info.java

    Now my service class is as below

    I see an exception is thrown while unmarshalling.

    From the code the UnMarshaller is expecting a addRequest and addResponse, but my SOAP request is

    Considering the fact that, I started WSDL first approach, can some one guide me, if my WSDL is in fact correct. If yes, what else I'm doing wrong here. I knew that JAXB objects were created based on xsd and the namespace and elements are different, but given a fact that JAXB objects are created separately after WSDL and xsd are designed, what else do I need to make for this to work.

    Please advise.
    Hi Rob,

    There is one question troubling me a bit on the approach you suggested, though my test against that logic proved satisfactory. We are adding a day from the starting day and comparing that with the current, this is pretty straightforward and looking great to me. Thanks for that. But I'm just thinking, if my program has to run for say 100 years from now, and it needs to calculate every day, that is time complexity is increasing as we move on. I did a sample test with the start day as Mar 01, 2011 and changed my system date to 01/01/2099 and ran the code... well I did not notice any significant increase in completing the loop. but would that have any impact in production, where other facts and load is considered.

    Also, how much can we loose, if we follow calculating millis and dividing by 24 * 60 * 60 *1000.
    7 years ago
    Your code is not complete and I'm assuming that you have deliberately removed some. Keeping that aside, where are you seeing null, at what line of hte code. I see tht your for loop is inside your while loop, but in for loop you are using temp[1] being set to all the record attributes, so ideally you are saving the same data....

    Try to run this in debug mode and you will find the root cause.
    7 years ago