chloe wong

Greenhorn
+ Follow
since Aug 02, 2006
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 chloe wong

You need to put the verbatim tag to wrap static HTML codes in JSF.

If you don't wrap it with verbatim tag, you'll end up having error printed on your console like below:



Perhaps the table you created is not in the view tag?
Possible for you to enclose the JSP page?
13 years ago
JSF
Hi, have you tried using



instead
do you have other tags, example like text box in B.jsp...i mean other than the commandLink
13 years ago
JSF
He is right. We use that tag to wrap HTML codes.
You don't have to specify the tag if you're putting those in head because it's not in the view.



If you want to put the HTML in view, you have to define the verbatim tag.

13 years ago
JSF
As a matter of fact, it can be done. You have to use dataList instead of dataTable. Assuming you have list in A,B,C..

dataTable will print list in:
A
B
C

where as dataList will print in A B C D ...




I hope this is what you are looking for.
13 years ago
JSF
just use the normal <script> tag. Of cos, in between f:verbatim


13 years ago
JSF
i have something like below:

which gives me

A
B
C
D

How can i make to display in

A B C D
E ...
14 years ago
JSF
==

This operator compares two object references to see whether they refer to the same instance. Meaning to say, it is used to check whether the two objects are the same object or not.

String s1 = new String(�mickey�);

String s2 = new String(�mickey�);

System.out.println(s1==s2); ��> returns false

String s3 = s1;

System.out.println(s3==s1); ��-> returns true

equals

This method creates two char arrays and puts the characters of each String objects in separate array and then performs the comparison.

String f1 = �mouse�;

String f2 = �mouse�;

String f3 = �MOUSE�;

System.out.println(f1.equals(f2)); ��> returns true

System.out.println(f1.equals(f3)); ��> returns false

equalsIgnoreCase

The special about this is it�ll do comparison on two String but ignoring the case of them.

String f1 = �mouse�;

String t1 = �cartoon�;

String t3 = �CARTOON�;

System.out.println(t1.equals(t2)); ��> returns true
14 years ago
for better secure, you can do some javascript validation checking.

Normally password are stored in DB as encrypted, not plain text.
So, in order to cehck the mactching, you can encrypt (MD5) your password frm login, then oni compare wtih the passwrod retrieve from DB.

Good Luck
14 years ago
Here's a simple example of doing it with Spring and JSF

Login.jsp
---------
.....

value="#{loginBean.username}"
....
value="#{loginBean.password}"
.....
action="#{loginBean.loginAction}"

loginBean
--------
..
private String username;
private String password;
public String getUsername(){return username;}
public void setUsername(String username){ this.username=username;}
public String getPassword(){return password;}
public void setPassword(String password){this.password = password;
...


public String loginAction()
{
String usernameTxt = this.getUsername();
String passwordTxt = this.getPassword();
try
{
//get the password from DB
...
//then compare with the one you get from the JSP page
//if not match, return to login.jsp
if(...)
{
return "LOGIN_PAGE";
}
}
catch(Exception e)
{
e.printStackTrace();
return "ERROR_PAGE";
}
return "LANDING_PAGE";
}
14 years ago
ops , sorry for the alignment
14 years ago


String [] jjj={"venkat","venkat","venkat"};

String [] kkk={"such","such","such","such","such"};

for(int i=0; i<jjj.length;i++)

{

for(int j=0;j<i;j++)

{

System.out.println("first"+jjj[i]);

System.out.println("second"+kkk[j]);

}



Based on your code, there is nothing wrong with the output.

i j j<i output
----- ---- ----------- -----------
i = 0, j = 0 false -
i = 1, j = 0 true firstvenkat
i = 1, j = 1 false -
i = 2, j = 0 true firstvenkat
j = 1 true firstvenkat
j = 2 false -
i = 3

That's how it prints 3 times first "venkat" and 3 times second "such"

Not sure if this is what you want....

public class Loop {

/**
* @param args
*/

public static void main(String[] args)

{

String [] jjj={"venkat","venkat","venkat"};
String [] kkk={"such","such","such","such","such"};

for(int j = 0; j < jjj.length; j++)
{
if(j == 0)
{
System.out.println("jjj = " + jjj[j]);
}
for(int k = 0; k<kkk.length;k++)
{
if(k<jjj.length)
{
System.out.println("jjj = " + jjj[k]);
}
System.out.println("kkk = " + kkk[k]);
}

}


}

}
14 years ago
another way to do it will be..

private selectStateList = new ArrayList();

public List getStateList()
{
selectStateList .clear();
SelectItem selectItem = new SelectItem();
selectItem.setValue("Alabama");
selectItem.setLabel("Alabama");
selectStatusList.add(selectItem);

selectItem = new SelectItem();
selectItem.setValue("Alaska");
selectItem.setLabel("Alaska");
selectStateList .add(selectItem);
return selectStateList ;
}
14 years ago
JSF
public List getStateList()
{
List dropList= new ArrayList();
SelectItem selectItemForDropList = new SelectItem();
try
{
dropList.add(new SelectItem(String.valueOf("Alabama"),"Alabama"));
dropList.add(new SelectItem(String.valueOf("Alaska"),"Alaska"));
dropList.add(new SelectItem(String.valueOf("Arizona"),"Arizona"));

}
catch(Exception e)
{
//do something

}
return dropList;
}
14 years ago
JSF
oops, sorry. Already changed back my displayed name.
15 years ago