vikky agrawal

Ranch Hand
+ Follow
since Dec 18, 2008
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
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 vikky agrawal

Hi,

Using Spring MVC framework for back-end tasks is superb, but I am confused which front end technology/framework is best suitable with Spring MVC.

While searching I came across few options:
1. Grails
2.Php (http://blog.caucho.com/2009/04/14/using-php-as-a-spring-mvc-view-via-quercus/)
3. Jsp

--
So could someone discuss this topic or throw some light of advantages/disadvantages of these technologies
If someone know about any particular technology to be used.?

10 years ago

Mr. vikky agrawal,

Thanks for your explanation
anyways i have resolved it long back



That is good, but I gave the explanation for the understanding of the reason that why output was not according to your expectation, hope this helps.
Enjoy
11 years ago


Now when you run this program,

if (st.nextElement().equals("d"))


if block will advance the tokenizer to next token i.e from f->a then again from b->c that is the reason you are getting output as a\c\, never think compiler is wrong.!
and according to you if you are not concentrating on if block then expected output should be f:\a\b\c
11 years ago
@Anayonkar Shivalkar and Seetharaman Venkatasamy

Thanks for correcting.. I overlooked the method signature and didn't paid thorough attention, as I was trying to explain mainly Hashing rather than hashCode signature.

Vikky


There is some discrepancy in the code. I think correct implementation should be like this:

Correct me if I am wrong.

Now coming to the point of hashing, according to this implementation the code will always return same hash value, if we supply similar integers inside this function call, hence all those entries will hash to the same bucket.
and based on the specification if two objects are equal according to equals method then hashCode must return true. Although this implementation will separate the objects having different value but still is inefficient as for large values supplied to the method the hashCode will return larger values and either we need large bucket or any other method (eg modulus %) to identify correct bucket. Hence a lot of values will coincide in the same bucket. And finding for equality will be inefficient if hashCode is inefficiently implemented.

Its best to use quadratic probing while implementing hash functions:
source: http://en.wikipedia.org/wiki/Quadratic_probing
Hope this helps to resolve your doubt.

Bear Bibeault wrote:You do not need to run from within the IDE. I use my IDE only as a fancy editor and run the web apps separately.



Thanks a lot Bear Bibeault.
I tried without ide and code is working fine.. it saved my lot of time now I can proceed further.

Vikky
11 years ago
JSP

Bear Bibeault wrote:You should be developing with the same server you will use in production. Otherwise, many surprises, none of them pleasant, await.



yes, you are right.. I am facing a lot of problems.. but the thing is code is already developed and I need to create new project with the same code for new enhancements and removing errors.
I tried to incorporate resin with netbeans but was not successfull.. then I switched to Eclipse and there I successfully added resin server but my problems increased there.

The jsp error which I was able to remove in netbens by changing

is not removing in Eclipse. I tried to change web.xml specification also, that too is not working.. now I am clueless how to start work on the code without removing such errors. :confused:
11 years ago
JSP

Bear Bibeault wrote:Your web.xml is wrong. Servlets 2.2? That's ancient!

See the JspFaq for info on declaring the web.xml as a Servlets 2.4 application.



yes, I tried to change web.xml according to 2.4 specification but it is not working in my case.. I think it may be a problem with server as we are using Resin 3.1.12 on production and I am trying to compile and run using Tomcat 7. on netbeans
As I already mentioned that all this code is working fine on production server.. the problem may be with some specifications that I am not able to locate. :confused:
11 years ago
JSP
Hi,

I am working on a web development project with spring framework. we are using Resin server : resin3.1.12 and having this issue :

According to TLD or attribute directive in tag file, attribute test does not accept any expression



My web.xml file looks like this :

and it is working fine on production server but creating a new project in netbeans with tomcat server(tomcat version 7) and using same code and all other files gives me the above mentioned error.
I tried this solutions, which I found on some blogs :

Reference the correct JSTL uri in your JSP,change



It worked and jsp error was removed.. but its not a feasible solution to change this in all jsp files.
and since the code already working fine, then such kind of changes may create problems on production environment.

Is it a problem with using different server, as I am using tomcat with netbenas and resin 3.1.12 on production environment.
Please suggest me what needs to be done, any kind of help will much appreciated.

Thanks !
11 years ago
JSP
Hi,

I am working on a web development project with spring framework. we are using Resin server : resin3.1.12 and having the same issue as above described.
My web.xml file looks like this :


and it is working fine on production server but creating a new project in netbeans and using same code and all other files give me the mentioned error.
I tried the solutions I found on some blogs:

Reference the correct JSTL uri in your JSP,change



It worked and jsp error was removed.. but its not a feasible solution to change this in all jsp files.
and since the code already working fine, then such kind of changes may create problems on production environment.

Anyone having idea from where this error can be removed and what is the root cause for this problem, provide reference if any.!

Thanks!

11 years ago
Hi,

I want to create a new web project with the existing code and I created a new netbeans project for that, when I tried to run the project, index.jsp is invoked and clicking on any link got following error : "The requested resource (/Test/manage.ctrl) is not available."
I think the problem is with web.xml as my servlets are mapped to different url and thus it is not able to find them.

In my existing web.xml entries are made like :


I am not good with web.xml mappings, so any suggestions or link to any tutorial for that are welcome.

Thanks.!
11 years ago
Hi Willaim,

Thanks for replying, I just created a new project in netbeans and included spring and struts framework and that resolved my problem.

Thanks..!!
11 years ago
Unreported exception org.springframework.mail.MailException
I am working on a project in Netbeans and there are several classes and in one class I am getting this error : Unreported exception org.springframework.mail.MailException.
I tried to enclose the text within try catch block


but that doesn't helps and the following error displayed:
incompatible types : required java.lang.Throwable
found : org.springframework.mail.MailException
11 years ago
Hello all,
while writing a jsp page i faced a problem using generics.


the error is:



ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 9 in the jsp file: /test.jsp
Generated servlet error:
Syntax error on token "<", invalid AssignmentOperator

An error occurred at line: 9 in the jsp file: /test.jsp
Generated servlet error:
Syntax error on token "=", != expected

An error occurred at line: 9 in the jsp file: /test.jsp
Generated servlet error:
Syntax error on token "<", ( expected

An error occurred at line: 9 in the jsp file: /test.jsp
Generated servlet error:
Syntax error on token "(", invalid Expression


at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)



when i removed generic syntax from Arraylist then the code works fine.
why this error and how to remove it.
13 years ago
JSP