Divya Sudarsan

Greenhorn
+ Follow
since Feb 16, 2010
Merit badge: grant badges
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Divya Sudarsan

Thanks all for the replies. I do not want true security here as the application demands so. I just want to hide the credentials from the user in a way that the target server of the redirect understands. I got it resolved by converting the string to Hex.
9 years ago
JSF
Hi,

From my Java application (JSF 2.0) I am doing a redirect to an external URL which has some credentials as a part of the URL string. I would like to encode the credential part alone before redirection. My code currently is


The URL generated by this code is


As we can see towards the end of the encoded URL, only the special characters like "/" have been encoded. i.e.

from userid=username/passwd@DBname to userid=%3Dusername%2Fpasswd%40DBname

I want to generate a URL which will have the the entire string "username/passwd@DBname" encoded . Something like :

userid=%63%64Please let me know if there is any way in Java to achieve this
9 years ago
JSF
Thanks for the reply. Can you please help me with samples which can make me understand in detail ?

Also my bad, only some of the properties are on disk. for e.g DB name. The others will be populated dynamically based on some business logic on the code.
9 years ago
JSF
Hi , I have the following code on the submit of command button on the jsp page



I need to send all the parameters after rwservlet? as hidden parameters. These values do not come from any form field on the page. They are a part of the properties file on the disk. I would not like them to be displayed to the user when loading the next webpage or on the next web page.

Please let me know if there is any way to mark specific parameters in externalcontext.redirect() as hidden programatically

The xhtml code is

9 years ago
JSF
Thanks for the reply.

what would you suggest for my situation which I have described in my initial post ? It is just a simple application with 2 links on the home page each doing different things. Can I have something like

Link1.xhtml-->Link1ManagedBean (Controller)-->BusinessLogicClass-->DatabaseHelper (Hibernate)

Link2.xhtml-->Link2ManagedBean (which calls methods on businesslogic class)-->BusinessLogicClass (Same as above)--> same DatabseHelper as above.

In future when somebosy else needs to add another Link3, he just needs to create his own xhtml, his own managed bean, and place his business logic in existing Business logic class, and reuse the Database helper/add new methods if required. Please let me know if this is the efficient way to design.


We are not allowed to use Spring in the current application. For DB, we need to use Hibernate. Any alternatives are also welcome
9 years ago
JSF
Hi,

Display name fixed
9 years ago
JSF
Hi,

I need to design a web page using JSF 2.0, whose home page displays 2 links. The 2 links point to 2 different xhtmls. These 2 xhtmls are forms with controls which take in user input and each does something different (by accessing DB). In future we plan to add more hyperlinks to the home page in addition to these 2.

I have the following questions :

1. Generally do we need one managed bean class compulsoruly for each hyperlink that I add to the home page (in this case, at present 2) ?

2. Is there any way to arrange all these now in a particular design pattern so that adding additional hyperlinks (which perform entirely different functions) in future would be easier ?

3. Can you point me to some sample applications in the web with the similar requirement ? Or can you just let me know the flow e.g. Link1.xhtml-->Link1Managedbean-->Link1DAO . Since I will be adding more completely different links in future, is there someway to have a generic managedbean or a business delegate class? Please guide

Thanks a ton for the help. I am totally new to JSF 2.0
9 years ago
JSF
Hi ,

I am currently learning selenium RC. I tried to run my junit selenium test case, it opens two firefox windows and then wait for the web page http://localhost:4444/selenium-server/core/Blank.html?start=true on one of the windows and eventually times out.

The web page intended to open also doesnt open.

Please let me know the issue.

SELENIUM SERVER LOG :


22:45:36.145 INFO - Command request: getNewBrowserSession[*firefox, http://www.g
oogle.com/, ] on session null
22:45:36.145 INFO - creating new remote session
22:45:36.145 INFO - Allocated session 9d0e1f4b80854fd3a02c6b048f621e65 for http:
//www.google.com/, launching...
22:45:36.192 INFO - Preparing Firefox profile...
22:45:38.380 INFO - Launching Firefox...
22:45:40.489 INFO - Got result: OK,9d0e1f4b80854fd3a02c6b048f621e65 on session 9
d0e1f4b80854fd3a02c6b048f621e65
22:45:40.489 INFO - Command request: open[/, ] on session 9d0e1f4b80854fd3a02c6b
048f621e65
22:46:10.613 INFO - Got result: Timed out after 30000ms on session 9d0e1f4b80854
fd3a02c6b048f621e65
22:46:10.613 INFO - Command request: testComplete[, ] on session 9d0e1f4b80854fd
3a02c6b048f621e65
22:46:10.613 INFO - Killing Firefox...
22:46:10.769 INFO - Got result: OK on session 9d0e1f4b80854fd3a02c6b048f621e65

My Junit Code


// We specify the package of our tests

import com.thoughtworks.selenium.*;
// This is the driver's import. You'll use this for instantiating a
// browser and making it do what you need.



public class HelloSeleniumTest extends SeleneseTestCase {
// We create our Selenium test case

public void setUp() throws Exception {
setUp("http://www.google.com/", "*firefox");
// We instantiate and start the browser
}

public void testNew() throws Exception {
selenium.open("/");
selenium.type("q", "selenium rc");
selenium.click("btnG");
selenium.waitForPageToLoad("30000");
assertTrue(selenium.isTextPresent("Results * for selenium rc"));
// These are the real test steps
}
}


Thanks,
Divya
12 years ago