Win a copy of Modern frontends with htmx this week in the Spring forum!

Shashank Sharma

Ranch Hand
+ Follow
since Sep 27, 2006
Merit badge: grant badges
Biography
getting back to hood..!
For More
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shashank Sharma

Hello,
I am using following code to print the request attributes on a jsp scriplet.




And here is the list of attribute it prints along with the custom added attributes as {key=values} format

javax.servlet.forward.context_path=,
javax.servlet.forward.query_string="request query string",
javax.servlet.forward.request_uri=/path/action.do,
javax.servlet.forward.servlet_path=/path/action.do,
javax.servlet.jsp.jstl.fmt.locale.request=en_US,
javax.servlet.jsp.jstl.fmt.localizationContext.request=org.springframework.web.servlet.support.JstlUtils$SpringLocalizationContext@44ad78a2,
lUrl=http://localhost:8888,
localStorageCall=true,
org.springframework.validation.BindingResult.accountDetails=org.springframework.validation.BeanPropertyBindingResult: 0 errors,
org.springframework.web.servlet.DispatcherServlet.CONTEXT=WebApplicationContext for namespace 'dispatch-servlet': startup date [Tue May 15 08:42:17 UTC 2012]; parent: Root WebApplicationContext, org.springframework.web.servlet.DispatcherServlet.LOCALE_RESOLVER=org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver@2b3a0934, org.springframework.web.servlet.DispatcherServlet.THEME_RESOLVER=org.springframework.web.servlet.theme.FixedThemeResolver@46ad89ec, org.springframework.web.servlet.DispatcherServlet.THEME_SOURCE=WebApplicationContext for namespace 'dispatch-servlet': startup date [Tue May 15 08:42:17 UTC 2012]; parent: Root WebApplicationContext, org.springframework.web.servlet.HandlerMapping.bestMatchingPattern=/path/action.do,
org.springframework.web.servlet.HandlerMapping.pathWithinHandlerMapping=/path/action.do,
org.springframework.web.servlet.HandlerMapping.uriTemplateVariables={}


Is there any way of configuring spring framework to not include these attributes in the requests.

Thanks









11 years ago
Congratts...
and thanks for sharing the web links.


More options for the Model
#Understand the roles of JDBC and JPA. #Understand the many elements that make up the model. #Understand fundamentals of connecting to a database using JDBC or JPA.
Asynchronous web applications
#Understand the interactions that are essential to asynchronous web pages. #Understand the role of AJAX-style client side programming. #Implement asynchronous servlets using the facilities of Java EE 6.
Web application security
#Understand the role of JAAS in pluggable/extensible authentication for web applications.
Container facilities for servlets and JSPs
#Use annotations to configure servlets.


Can any one please provide any link for study material for above mentioned topics.. as these are added newly for 1Z0-899 exam.



Thanks

Hello,

Thanks you for your response.
I have tried that. it redirects the page to the login error page.
It means it is not able to match the username password specified in the tomcat-users.xml with the ones that I am passing on the login page.
And am using login config which specifies the login page for authentication and an errorPage if incorrect authentication information is passed .

but what it is supposed to do If the credentials are correct.
I could answer most of the question at the end of the chapter.but that is no use unless I am able to implement the security constraints.
Frits It would be great If you could explain a bit on the constraint part which I am not able to get through the book.


Thanks .
moving on..


These are the username and role mapping in tomcat-user.xml file

and I am trying to use form authorization as

on using user name and password as above it always get redirected to the login Error page.
the web xml is as under.




Hello,
I am reading through web app security of HFJS I could add an constraint for certain url pattern through <security-constraint> tags in DD.So it would restrict me to request a constraint resource.
I am not able to understand how the user roles of apache tomcat will authorize the request.We can login to one for the tomcat account to manage the app and check the active session for the app..but it does not allows me acces a constraint resourse if I am logged in as a admin too.
>auth-constraint> lists roles which can do a Get or a Post request.
I have >auth-constraint> as


Can Anyone please explain how this authorization is done.
Thanks ..
Hello Frits ,
I have the doubt on the same example.
I am using the code snippet as used by kevin but without the nested variables and having only one attribute user.
I have kept <body-content>tag as empty
and am using the tag as

but it says " Expression language not allowed in a template text body".

thanks






Hello Ritika,
I also used Wizlabs simulator for scjp 6 exam.
but Wizlabs simulator for JEE6 exam is not yet released .Can you provide any info about the release.as the website just take the email address for some initial discount but does not states when it going to be made available for purchase or trial.

Thanks
Shashank
Hello faisal,

"The Container finds the correct servlet based on the URL in the request, creates or allocates a thread for that request, and calls the servlet’s service() method, passing the request and response objects as arguments."

.
Above lines explains the flow of request and response for a web app.Check your Deployment Descriptor(web.xml).Your app's web.xml is the access point for the request to reach the correct servlet it is ment for.
Once container gets a request ,it maps the URL in in web.xml as servlet mapping and assign a thread to the request .This thread accesses service method of the matching servlet which takes request and response as the arguments.
Thats one of the many roles of the container.

If the servlet class file gets loaded thread will call the service method other wise container will not able to find the correct servlet and will throw ClassNotFound.And assigned thread is ment for calling the service method which depending upon the type of request calls doGet or doPost .


Thanks
Shashank
Hello Nitesh,

So far option c i.e creating a JSON of a String arrays having JSON as content works for me. For 'data loss' i mean chance of my json breaking up due to the type of content. as there will be a lott of data being passed as json string.

Thanks
12 years ago
Hello all.
I am working on a client server architecture application. for which I am using Restlets Clients Response and Http Connector For Remote procedure Call.
I want to pass two objects as response.
so I am creating json for both using Jakson object mapper.



now In order to pass it to the client I can
a)pass the above two json string as a string separated with a delimiter like'~'
b)pass a string array having two of these json strings.
c)create a json having two of these json strings its content //not able to implement.
d)send a restlet object

I really dont wana use a) there can be chances that my string contains the delimiter as the content value.
b)am facing a parsing error....
c)it is working fine for me... need to figure if there is any chance of data loss.
d)heavy response... want to avoid....and want to reduce no of client -server calls.

would like to know you comment on the above mentioned procedures for sending response.


Thanks for your time reading this post.
12 years ago
Hello
I am using following code for parsing a HashMap<string,Object>

but on deserializing it as

12 years ago


SEVERE: Servlet.service() for servlet RestServlet threw exception
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.restlet.engine.Engine.loadClass(Engine.java:242)




Hello I am struggling with the same error.
My server side application is using jdk 1.5 specification.
when I build it through eclipse 1.5 compliance setting and exporting it as a war file to the server tomcat web apps folder. I am getting the same error.
I have build the application using dynamic web project 2.4.
In project facets section I have following points checked.

1.Dynamic web module :2.4
2.Java :1.5

Will my windows environment variable affect the eclipse build settings??



12 years ago
Hello,
I am new to spring frame work have prior exp on struts 1.3.


I am having problem binding bean element with the spring form element.
Web Reference:-
Spring Tutorial

JSP

Controller

servlet-dispatcher


Error:-
Problem accessing /userRegistration.do. Reason:

java.lang.IllegalAccessError: tried to access method org.springframework.validation.AbstractPropertyBindingResult.getCustomEditor(Ljava/lang/String;)Ljava/beans/PropertyEditor; from class org.springframework.web.servlet.support.BindStatus

I am using web based tutorials for spring 3.0 .Please guide for further path and resources to master spring.





Thanks





12 years ago