Mukhi Vla

Ranch Hand
+ Follow
since Apr 22, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mukhi Vla

Can some one tell me how to handle multiple pages with same Form bean.

Eg: I have page1,page2,page3 and submission happens at page3. in page1, and page2 the available buttons are cancel and next.

I am using spring 4.

Thanks
7 years ago
Hi , I am getting '500 Bad Request' upon calling RestTemplate.postForLocation() method.

Details as follow. Throwing exception at the following line in my code.



Error Stack trace

Spring RestTemplate: POST request causes 500 Bad Request

java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
at edu.aspire.spring.rest.test.CustomerResourceTest.testInsertCustomer(CustomerResourceTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.methods.HttpUriRequest
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 24 more





I have tried copying jar file that contains HttpUriRequest. But problem is not solved.


Thanks
8 years ago

When you use 'wsdl2java' command to generate client stubs, that time these stub classes will get generated.
9 years ago
Hortonworks has simple step by step tutorial easy to follow.

Go to the following url and download sandbox, you can start practicing from there..



http://hortonworks.com/hdp/downloads/
9 years ago
I got it. I will have to try AJAX. In my jsp I don't have any form submission. There is a href link that is redirected to a controller class. But before going to the controller I should have this value set.

Thanks
I want to get the selected value on jsp page from the javascript function. To set that value to session.

Hi all,

Can any one help in how to get value back from jQuery function?

My purpose is to get a selected value from list box when Button is clicked.

When I click on the button I am invoking a function , in that function i am able to alert the selected valu. But I want that value on .jsp page to set the selected value to session.

My code in .jsp page




code from .js file



how to get the selected width back to jsp file?


Can some one tell me what is spring POJO container? According to serach result... What I understand is .... spring with annotations is called Spring POJO container. Is this correct?

13 years ago
It is not saved in 'SPRING_SECURITY_SAVED_REQUEST'. I tried getting it using request.getSession().getAttribute("SPRING_SECURITY_SAVED_REQUEST").

Name of my attribute is 'siteSpecificBean' in my custom filter class.
This is set by me.
13 years ago
If the image is in your servlet context path try this



add this logoImage to your map object which you pass to velocity template.

In template use ${logoImage}
13 years ago
I have one more problem in my appliucation. This is realted to application.properties values in my JSP.

Please see this link if you are interested https://coderanch.com/t/500725/Spring/properties-file#2257495


Thanks
13 years ago
I turned on logger and check the sequence. My custom filter is hit first for sure. I am able to get the attribute in all the other classes except this class. I think there is some mechanism in spring security that is hindering this object to get the attribute. I read other forums addressing this issue. Thanks for analyzing my problem.
13 years ago

Are you sure that the filter where the attribute is set comes before the filter you want to access it?



Yes.

My custom filter(where I set request.setAttribute) is extended from 'org.springframework.security.context.HttpSessionContextIntegrationFilter'.

And my authentication filter class(where I have 'onSUccessfulAuthentication') is extended from 'org.springframework.security.ui.webapp.AuthenticationProcessingFilter'.

The custom filter is configured in web.xml using <filter> and <filter-mapping> tags.
the authentication filter class is configured in my app-security.xml file using <security:filter-chain-map>. So I don't have this custom filer reference in my app-security.xml file to specify the order. And I am pretty sure that this custom filter is hit before I get to the authentication filter.


Thanks.
13 years ago
Do you have messages.properties file in your classpath?
13 years ago
I have a requirement where I want to get the request attribute set from my custom filter class. In my filter class I have set an attribute to request scope. When I try to get the attribute in 'onSuccessfulAuthentication' method using request.getAttribute("attrName") I am getting null. the other way to get this attribute is setting it to a session. But I don't want to set a session in that filter because every request pass through this filter and it creates large clusters if I set a session. Can any one suggest me any other way to achieve this.

I tried getting 'SPRING_SECURITY_SAVED_REQUEST'. but this is not returning me the attribute set in the previous class(my filter class).
13 years ago