Ritu varada

Ranch Hand
+ Follow
since Sep 08, 2004
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ritu varada

That fixed it. That's a basic Java 101 concept that I forgot. Thanks for your help!
6 years ago
I am currently reading Head First Android Development. In chapter 6, its shown how to display a list using android.R.layout.simple_list_item_1.
When I test run the StarBuzz app, instead of showing the list, it shows the object name(com.hfad.starbuzz.Drink@3fsfsf). I ran using a Android phone(Android V4.2) and the emulator.
Same result. What could I be missing?


6 years ago
Thanks Ankit. It displays okay if I have 'color-red' but if I do

pausecontent[2]="<div class= & # 39color-red & # 39>

Trying out javascript quotes today , 08/27/2009

</div>"

It still does not convert the & #39 to single quotes whereas it converts & # 44 to be comma.
I am trying to use a javascript based scroll. The scroll's content comes from a javascript array.


To be consistent with the rest of html generation, we wanted to use ascii html for all the special characters but the browser ignored double quotes code which specifies the css class, which meant that the text did not change color as the css class specified.
I am a novice to javascript.So, I am not able to figure out why the browser executed the html ascii code (which puts a comma) within
the array string but not the one that specifies the css class.

It have deliberately put space between & # 34 so that the browser does not interpret this.
I will post this in the jasper forum but since I am having issues in the java code, I thought somebody could help me if I am doing anything stupid in my java code.

Here is the issue. I have 2 jasper reports almost identical except one is used to generate pdf file and another one just old plain text file. I have a subreport in the summary band of the main report page. The code is below.


The problem is when I generate the text file, the subreport data does not come up if I generate the pdf file first.
If I comment out //JasperPrint jPrint = Utils.buildJasperPrint(reportParams, inFile,a); for the pdf then it generates the sub report for the text file.
What am I doing wrong?
I am not sure whether to post it under websphere/portal forum. But since this is more
websphere oreinted, I am going to ask it here. We are using Portal 6.0. To provide custom login/log out for
websphere portal, we have subclassed the LogoutUserAuth.java under com.ibm.wps.engine.commands
and overridden onUserSessionTimeout, doPreLogout and doPostLogout methods. Originally, on a
session timeout, all these 3 methods were being called and we were able to redirect our users
to the login page.We customized the code to add another logout redirection and since
then the doPostLogout does not get called on session timeout at all. This way, all the portlets
error out instead of the user being logged off. What could cause such a scenario where
doPostLogout is not invoked?
Thanks for your help.
13 years ago
I used java.net.encoder and decoder classes to encode and decode my url. That works fine. Thanks.
13 years ago
13 years ago
Well, the code definetely compiles. I had to change the "c" to "k" for cookie since java ranch posted that as a solution when posting code.
13 years ago
if (session.isNew() ) {

String ref_value = null;
boolean refFound = false;


String referrer = request.getHeader("referer");

Cookie[] cookies = request.getKookies();

if (cookies != null) {
for (int i=0; i< cookies.length;i++) {

Cookie cookie = cookies[i];

if (cookie.getName().equals("referrer")) {
System.out.println("Cookie referrer found");
ref_value = Kookie.getValue();
System.out.println("referrer value using cookie value is " + ref_value);
refFound = true;
session.setAttribute("referrer", ref_value);


break;

}
}




if (!refFound) {
if (referrer!= null && referrer.length() > 0) {

Cookie cookie = new Cookie("referrer",referrer);

cookie.setMaxAge(30*60);

response.addCookie(cookie);

session.setAttribute("referrer", referrer);
System.out.println("setting session attribute referrer using referrer");
System.out.println("setting cookie" + Kookie.getValue());
}
}


}
13 years ago
I am writing some code to store the referral url in a cookie and then trying to retrieve it back. For example, my referral url is www.google.com and I set my cookie, "my_cookie" with "http://www.google.com". I am using the cookie.getValue to retrieve "my_cookie". When I do that, I only get the "http" part and it does not return me the whole url. Do I need to escape for the : and // characters? Appreciate anybody's input.
13 years ago
Thanks a lot. I will explore that option.
I have configured log4j to output all my ERROR statements. But if there are no ERROR statements , I don't want it to create a log file. Now it creates a log file no matter what. I am doing this for a reason since if there is an ERROR log file, I need to email it to our team. Since log4j creates a file no matter what, I have to incorporate a logic to check for 0 bytes file. So, I was wondering if there is a way around that in log4j settings.
Hey folks,
How can I configure log4j to make sure it only creates a file if its not empty?
Well,never mind. I should have thought about it a little harder. I did
<include name="a/b/c/*.class"/>. That way , it did not include b's classes. Hopefully , its okay to do that. Thanks anyway!
17 years ago