ryo gin

Greenhorn
+ Follow
since Jan 28, 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 ryo gin



Hi to all,

I am a beginner of JSF.

Can anayone help me explane the difference between bean and backing bean.

If its ok for you, please give me a sample code so that I can identify the difference.

Thanks in advance,
*kato_ryo*
14 years ago
JSF

Its ok! I understand...

by the way, thanks for the information and thank you also for the link,
Its a very good tutorial for jsf beginners

Regards,
*kato_ryo*
14 years ago
JSF

sorry if my codes is nasty for I am only a beginner and Im sorry also if my english(grammar) is bad because Im poor in english

can you please give any sample.

Thanks in advance Mr. Jason Porter.

*kato_ryo*

14 years ago
JSF
this is my jsf file:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Welcome to JSF</TITLE>
</HEAD>
<BODY>
<f:view>
<h:form id="AddForm">
<f:param id="par" name="param" value="JACK" />
<h:commandButton action="#{MyBean.display}" value="SAVE" />
</fieldset>
</h:form>
</f:view>

</BODY></HTML>


this is my bean: MyBean

package pack;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;

import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;



public class MyBean {

//MyBean bean=null;
private String fname;
private String lname;
private String mname;

public String getFname() {
return fname;
}
public void setFname(String fname) {
this.fname = fname;
}
public String getLname() {
return lname;
}
public void setLname(String lname) {
this.lname = lname;
}
public String getMname() {
return mname;
}
public void setMname(String mname) {
this.mname = mname;
}

public void display(){

String p = (String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("AddForm:par");
System.out.println("parameter: "+p);

/*AddForm is the id of the form and par is the id of the f:param*/

ExternalContext econ = FacesContext.getCurrentInstance().getExternalContext();
HttpServletRequest request = (HttpServletRequest) econ.getRequest();
System.out.println("Requested parameter: "+ request.getParameter("param"));

/*param is the name of the f:param*/

HttpServletRequest request1 = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
String value = request1.getParameter("param");
System.out.println("Third try: "+value);

/*param is the name of the f:param*/

}

}

I have found this code in the internet ...???
Whats wrong...???

Please help me

*kato_ryo*
14 years ago
JSF
hi,

I am a beginner of jsf, I am studying jsf for more than two week.

My very big problem is passing parameter from jsf file to bean.
I search from the internet but still i did not find any solution that works properly.

I used several code like:
1. String param = (String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("FormID:paramID");
2. ExternalContext econ = FacesContext.getCurrentInstance().getExternalContext();
HttpServletRequest request = (HttpServletRequest) econ.getRequest();
System.out.println("Requested parameter: "+ request.getParameter("paramID"));

but this codes does not works.What shall i do...???

Please help me .


Thanks in advance,
*kato_tyo*
14 years ago
JSF
Hi,

I am a beginner of jsf, please give me a sample code that save's to database.
I am studying jsf for several weeks but still i don't know how to save to database.

Any sample will be accepted

please help me.

Thanks in advance,
*kato_ry *
14 years ago
JSF
Hi to all,

Im a beginner of jsf. I dont know how to connect to database. I am using ubuntu linux and my database is postgresql.

Can anyone help me give a sample program that save's to database?
Im very thankful to you if you help me.

Thank you in advance,
*kats_ryo*
14 years ago
JSF