Vineet kumar Gupta

Greenhorn
+ Follow
since Dec 18, 2011
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 Vineet kumar Gupta

hello seniors....

i want to host my jsf web application ...for it i have purchased a domain name...suppose abc.in ...now i want to host it on my own computer ....using my dynamic ip

i am using apache tomcat ...........

if it is possible to host a application on my home computer ??? and i also want that the domain name which i have purchased ...to be used

one thing more ....suppose my current public ip is.... 223.223.43.45 ....right now i am able to acces my application on another computer ......using ...
223.223.43.45:8080/myapp


i only want to know how to bind this 223.223.43.45:8080/myapp to my domain
abc.com ?? they are saying add nameserver something like it.....i dont know what is it nameserver

if any one about this please help
11 years ago
JSF
but if i do like that


pw.println("hello"+cont.getExternalContext().getSessionMap().get("validbean"));

here validbean is a bean which have application scope/session scope ...means i am trying to access loginbean into validbean...

.
what is the location where l can get the loginbean ....??? getsessionmap() is not containing that

someone please help
11 years ago
JSF
i want to access the session scoped bean named "loginbean" into another bean ...how can i do it ???
11 years ago
JSF
if the scope of loginbean is session then it should not be null...


pw.println("hello"+cont.getExternalContext().getSessionMap().get("loginbean"));
but it is showing hello null
....anyone help ???
11 years ago
JSF
i have all .jar files installed at correct position...and getting ""


package jmail;

import java.util.Properties;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;



public class mail implements ActionListener
{
public void processAction(ActionEvent event) throws AbortProcessingException
{
final String username = "vkg.ssdn@gmail.com";
final String password = "password";

Properties prop = new Properties();
prop.put("mail.smtp.auth", "true");
prop.put("mail.smtp.starttls.enable", "true");
prop.put("mail.smtp.host", "smtp.gmail.com");
prop.put("mail.smtp.port", "587");
FacesContext cont = FacesContext.getCurrentInstance();
HttpServletResponse resp=(HttpServletResponse)cont.getExternalContext().getResponse();
HttpSession ses=(HttpSession)cont.getExternalContext().getSession(true);

Session session = Session.getDefaultInstance(prop,
new javax.mail.Authenticator(){

@Override
protected PasswordAuthentication getPasswordAuthentication(){ return new PasswordAuthentication(username,password);} });

try
{
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(("vkg.ssdn@gmail.com")));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("vkg.ssdn@gmail.com"));
message.setSubject("Testing Subject");
message.setText("hello friends this is great job....,"
+ "\n\n No spam to my email, please!");
Transport.send(message);
System.out.println("done");
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}

}
11 years ago
JSF
Not in this way...
Write the full code and step step by step ...
11 years ago
JSF
I am getting an error that..
Unknown smtp host ..when I am passing it the
smtp.gmail.com
11 years ago
JSF
But how to display this table on a button click....
I mean I am not getting the table on button click...
12 years ago
Okk friend...you are right...first I have to know about the jtable ..and.its structure ....thank you for your guideline...
Go to this page I want to use jtable like it...there is a table view

http://docs.oracle.com/javase/tutorial/ui/overview/demo.html
You are saying that I should design the project in notepad by coding....? I do not have enough time friend...i hv almost completed it but ...the scenario is ....i hv a table in sql named student...now I hv a button say "view all" by which I want to see all the records of student table.....please guide me..
Yes I am a new lerner of java and working on a project..my faculty not helps me..thats why I am here... I even dont know how to use a jtable.... I do not want to create it by coding... I have draged and dropped already a table from palette in netbeans.... Number of rows and columns are same as in sql table ...now I want to show sql table in jtable....
How can I achive this.... guide me...

what is the method of setting records in a jtable....lyk for jtextfield is...
Jtextfield1.setText(rs.getString("name"))..

What will be for jTable.?
What will be the way of retriving records from resultset and placing these on a jtable....

Thank you tim maroos... It is working

How to retrive multyple rows from a data set ...i am getting only last row because of
While(rs.next())
(
Jtextfield1.settext(rs.getString("name"))
jtextfield2.setText(rs.getString("name"))
)
In both text fields I am getting same result .
only last row record just beacuse of while loop

But I want to set 1row and 2 row records respctvly..
What should I do...?