Hitesh Kumar C

Ranch Hand
+ Follow
since Sep 12, 2008
Hitesh likes ...
Eclipse IDE Java Linux
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 Hitesh Kumar C

Thanks for the such a nice observation.
Got the concept.

Thank you so much.
It worked. When you click on Print this Exam and it's displaying all the topics.
Thanks.
Hi,

I just want to know the exam topics for the subjected exam. When I am opening the Oracle Site for the exam topics link the link is not for working for me(Exam Topics).

I'm sorry, i am not able to paste the exact link which I'm accessing for the exam topics, because it contains some abbreviation and coderanch is not allowing me to submit the post along with that link.

Please suggest, where i can see the course topics on Oracle site?

Thanks in advance.
Hi All,

While preparing for OCEJWCD, i was working with the Form Authentication.

I'm able to implement it with Tomcat 7.0 Web Server, but i have one doubt in the behavior of how Form Authentication actually works.

Here is the behavior which it got understood that is working fine.



Behavior which i didn't understood is:

(Why?)

Once, I'm authenticated and if i'm trying it again with same user name and password configure in tomcat-users.xml, I'd end up with this error:

HTTP Status 404 - /Authorization/j_security_check

type Status report

message /Authorization/j_security_check

description The requested resource (/Authorization/j_security_check) is not available.
Apache Tomcat/7.0.10



JSP File:


web.xml



tomcat-users.xml


My question is that if I'm already authenticated and I'm on login.jsp and I'm trying login again then why I am getting the Http 404 Error? and the same configurations worked for me while login initially?

Please give your suggestions on this and update me if I've done something wrong.

Thanks in advance.
Sorry for so much delay in the reply.

Thanks a lot for writing in so much detail.

I got understood the flow, using your statement, that actually when it calls the HttpSessionBindingListener.



Thanks a bunch.
Hi,

I'm Preparing for OCEJWCD6.0 and while studying the Headfirst I got confused on one question in Chapter 6 - Session Management.

Mock Question no. 9 :

And the answer is F (HttpSessionBindingListener and HttpSessionAttributeListener)

I've configured the HttpSessionAttributeListener and HttpSessionBindingListener in web.xml and HttpSessionAttributeListener is getting called up(It's fine, I got the concept). But for HttpSessionBindingListener, It didn't get called even though i've configured it in web.xml.
In the answers, there is an explanation:

because an HttpSessionAttributeListener is notified any time an attribute is added and the value object will also be notified if it implements an HttpSessionBindingListener.



My Question is that When the HttpSessionBindingListener methods :
public void valueBound(HttpSessionBindingEvent event)
public void valueUnbound(HttpSessionBindingEvent event)
get called up?

Code snippet :


Please put your comments on it or correct me if i'm doing something wrong.
A great explanation.
So, it doesn't promise to maintain the order in case of storing. Got the point.
Thanks a bunch.
Hi All,

While preparing for a SCJP 6.0, i come up with one question about the PriorityQueue . In the API of Version 6, its written that

An unbounded priority queue based on a priority heap. The elements of the priority queue are ordered
according to their natural ordering, or by a Comparator provided at queue construction time, depending on which constructor
is used. A priority queue does not permit null elements. A priority queue relying on natural ordering also does not permit insertion
of non-comparable objects (doing so may result in ClassCastException.



Code snippet :



Output :


If the elements added in the PriorityQueue are naturally ordered then wouldn't it produce the result?

Little bit confuse with the output, kindly give your suggestions.
Do correct me if i'm wrong anywhere.



Paul Anilprem wrote:Replace your sout with System.out.println("Constructor invoked "+name()); and then check out http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html That should help you understand what is going on.



Thanks for the suggestion.

Got to know that for each enum the constructor is getting called up.

Confusion is over.

Thanks again.
I created a constructor inside an enum, just curious to know that how actually it is working?

I just initialized the Computer c = Computer.PERSONAL and constructor is getting invoked two times.
No matter, now many instances i should create apart from compObj, but the constructor is getting invoked 2 times only.

Can any body help me on this logic, how its working?
Sorry guys!

There was a very little mistake, i changed validations.xml to validators.xml and it starts working!

Thanks.
8 years ago
Hi,

I was trying to achieve vaidation using Struts2 custom Validation, i 've defined the configuration as per the process.

Custom Validator :



Action:



UserRegistration-validation.xml:


validation.xml:



JSP:


Struts-config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">




while running this application it is giving me this error

02:44:15,121 ERROR [com.opensymphony.xwork2.validator.AnnotationActionValidatorManager] Caught exception while loading file mypackage/UserRegistration-validation.xml: Invalid validation type: customeemail - field-validator - file:///E:/Servers/jboss-6.1.0.Final/bin/mypackage/UserRegistration-validation.xml:33:39
at com.opensymphony.xwork2.validator.DefaultValidatorFileParser.addValidatorConfigs(DefaultValidatorFileParser.java:181) [:2.3.7]
at com.opensymphony.xwork2.validator.DefaultValidatorFileParser.parseActionValidatorConfigs(DefaultValidatorFileParser.java:101) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile(AnnotationActionValidatorManager.java:387) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildClassValidatorConfigs(AnnotationActionValidatorManager.java:272) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs(AnnotationActionValidatorManager.java:364) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:95) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:134) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:126) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:121) [:2.3.7]
at com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:222) [:2.3.7]
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) [:2.3.7]
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) [:2.3.7]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:238) [:2.3.7]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:238) [:2.3.7]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) [:2.3.7]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) [:2.3.7]
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:544) [:2.3.7]
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434) [:2.3.7]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.1.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [:6.1.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159) [:6.1.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.1.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.1.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.1.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.1.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.1.0.Final]
at java.lang.Thread.run(Unknown Source) [:1.6.0_20]

Can anybody suggest? what is the root cause of this stacktrace.

I've put the validation.xml under src folder(java class path) then why it is not able to get the validator.

Kindly reply.
8 years ago
Can anybody tell me how to clear the Cache in JSF in @SessionScoped?
8 years ago
JSF
Any Comments!
8 years ago
JSF