Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Abhilash Chander

Ranch Hand
+ Follow
since Oct 18, 2009
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abhilash Chander

Hi All,

I am using jquery on my front end for a shopping cart application. After the cart is filled, on pressing save button the data will be saved into the database through a JSP.

Below I built the array from my cart items using jquery :




Then I post my array from jquery to JSP page 'SaveOrderDetails.jsp' as shown below :




Below are the parameter names I am getting on the JSP page :

orderDetails[2][gender],
orderDetails[2][price],
orderDetails[0][gender],
orderDetails[0][price],
orderDetails[2][name],
orderDetails[1][gender],
orderDetails[1][name],
orderDetails[1][price],
orderDetails[0][name]



As they are individual parameters, how can I fetch them as a two dimensional array instead of individual parameters. Because count of array is going to vary with number of items added to the cart.

My attempt to fetch the array on JSP page :



Hope you guys can take some time to help. Thanks for your help in Advance.
Hi All,
I have setup JAMES email server on my local windows system. Now I am trying to send mail to my yahoo account but I am getting the following error


13/11/10 12:39:56 INFO James.Mailet: RemoteAddrNotInNetwork: Authorized addresses: [127.0.0.1/255.255.255.255, 0.0.0.0/255.255.255.255, 192.168.2.0/255.255.255.0]
13/11/10 12:39:56 INFO James.Mailet: RemoteDelivery: maxRetries is larger than total number of attempts specified. Increasing last delayTime with 19 attempts
13/11/10 12:39:56 INFO James.Mailet: RemoteDelivery: Delay of 21600000 msecs is now attempted: 20 times
13/11/10 12:40:04 INFO James.Mailet: RemoteDelivery: Attempting delivery of Mail1289631302656-0-to-yahoo.co.in to host mx1.mail.in.yahoo.com. at 180.222.96.138 for addresses [abhilash@yahoo.co.in]
13/11/10 12:40:04 INFO James.Mailet: RemoteDelivery: Could not connect to SMTP host: 180.222.96.138, port: 25, response: 553
13/11/10 12:40:04 INFO James.Mailet: RemoteDelivery: Temporary exception delivering mail (Mail1289631302656-0-to-yahoo.co.in:
13/11/10 12:40:04 INFO James.Mailet: RemoteDelivery: Storing message Mail1289631302656-0-to-yahoo.co.in into outgoing after 0 retries



As per the FAQs most probably I have some problem configuring my DNS server. So what I should set my DNS server to - my system's internal ip, my router's ip , my public ip. I'm confused. Any suggestions kindly share.

Thanks
Abhilash
11 years ago
Hi All,

I want to set up a mail server for my web application. I installed and ran JAMES as per the apache JAMES wiki but as it is an standalone server. I wanted to know how can i integrate JAMES into my web application i.e send emails and other oprations through my web application front end. For example whenever you register with a website they shoot you a mail for verification of the email account. I want to do the same but have no idea how to do that. Kindly suggest some good tutorial or advice on how to do that. Kindly help. Thanks for your time.


Abhilash
Hi All,
I am adding articles to my portal. What I wanted to know is what is the best way to store and display articles. Should the article and all the information pertaining to it be stored in a database system or in a file system ? Secondly, how the formatting of the articles is taken care of ? As some of them may have pictures associated with them and others don't. Kindly help. Thanks for your time.


regards
Abhilash
11 years ago
Hi All,
I am using an accodian to display user comments on my page. When somebody clicks on the accordian, it opens and the comments page is loaded inside the accordian using AJAX. Now what my question is, will search engine crawlers be able to crawl comment page or not ? As it is not a part of the page initially and is loaded and displayed only when the accordian is clicked. Pretty confused about that. Thanks for your replies in advance.

regards

Jan Cumps wrote:When you define a method of your class as private, nothing else than your class can use that method. You have restricted the access.
JUnit can't test your class, because you have forbidden JUnit to access it.



So what I am supposed to do in such a situation. Make all my methods public for testing purpose. And after the testing, change them back to private. But that is more prone to errors in two ways.

1. Some of the methods were left public after testing, which were originally private.
2. Secondly, code works fine when methods are public but problem occurs after I changed them back to private. Because of some access issue.

Kindly suggest

Abhilash

11 years ago
Hi All,

I have a method defined as private in my class. Now I want to create a test for it in JUnit. But I can't. Can somebody tell me why its not allowed in unit testing and wat is the wayaround.


Thanks
11 years ago

Abimaran Kugathasan wrote:In the first code, you've called an instance method on a static method without an instance. And, in the second case, you've an instance named tm, so can call the instance method of that class on this instance!



Thanks . Got it !!!
11 years ago



Static methods are loaded at class loading time. And it's belonging to class, not to a single instance, so you can call that method without any instances. But to call a non static method, you need an object. Because it's belonging to instances of the class. If you call the non-static/instance method from static/class method, compiler can't determine, on which object you've called the instance method. So, it won't allow it!



I agree what you are saying. But I have two cases, First Case :


Main Class




SECOND CASE

Main Class




TempMain




Here FIRST CASE gives me an error for calling a non-static method from a static context whereas SECOND CASE works. Now the only diffrence between the two is, in FIRST CASE the non-static method is in the same class and in SECOND CASE its in another class. But the calling is same for both cases i.e from a static context to a non-static method. Then howcome one works other doesnt. Still not clear why its happening
11 years ago
Hi All,

I have a question about static methods. If I call a non-static method from a static method in a class, I get an error "non-static method XXX() cannot be refrenced from a static context". But if I call a non-static method which is present in some other class, it works. How is that possible ? Because its still vague which instance of the class is being used to call the method ? Hope you will thow some light on that. Thanks to all.

Abhilash
11 years ago
Hi All,

I have been developing J2EE web applications from last 3 years. I use Struts 2 for the same. Recently I came across these articles about 'Programming to Interface not Implementation' and 'Design Patterns'. And I am completely amazed by the amount of flexibility, security and scalability you get by using these set of rules. I am also looking forward to designing applications and developing Java based APIs. So for that very reason I am reading 'Head First Design Patterns' these days. Though I am now quite familiar with the purpose of using 'design patterns' and 'programming to Interface not Implementation' but when it comes to implementing the same in my application I am completely confused. Even When I implement these rules they seem unnecessary and just for the sake of 'Design Patterns' implementation. My question is for expert developers -

How can I develop 'Programming to Interface not Implementation' coding style ?
What path should I take to learn 'Design Patterns' ?
Are there any other good books that may help learning 'Design Patterns' or 'Interface based programming' besides Head First Design Patterns' ?

I have been trying from last few weeks but of no use. Please help.

Thanks to All
Abhilash ''
11 years ago

Richard Golebiowski wrote:Try the following, using OGNL:



Richard that worked like a charm. Thanks for your help.
11 years ago
Hi All,

I have a struts 2 select element to select the mumber of results to be diplayed per page. I set the selected value in a session variable. On the JSP page I want the user selected value to be pre-selected in the select element. If I hard cord the value it works like this



But if I use value from session using the <s:property> tag it doesn't work



Please help how can I work this out. And secondly, It is always so confusing when it comes to using one struts2 tag inside another. Can somebody provide the sysntax how to use one struts2 tag inside another.

Thanks in advance.
11 years ago
Hi All,
I want to implement ORM solution in my application and I am thinking of using Hibernate for the same. But as I am using Apache Tomcat web server I wanted to know what are the memory requirements of Hibernate ? And is Hibernate going to have a major negative effect on the overall performance of the application because of its hunger for memory. Opinions and Suggestions are welcomed.

Thanks
Abhilash
Hi All,

I use resin 3.0.25 web server for my application. Earlier application's context path was "/myApp". But now I have deployed it as ROOT, So I changed the context path to "". I have an index.jsp which is the welcome page of the application and it does nothing except for redirecting to my struts 2 action. When the context path was "myApp" everything was fine but now that I have changed it to "", index.jsp page gets called but redirection fails as application is unable to find struts 2 action and throws an HTTP 404 not found error. Please help

Thanks
Abhay
11 years ago