Results 1 to 2 of 2
- 01-27-2010, 06:36 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 57
- Rep Power
- 0
is it fine that my java programs sharing same JavaBean?
i have 3 packages:
package beanpackage;
public class JavaBean {
private String a = null;
private String b = null;
public JavaBean(String a, String b) {
super();
this.a = a;
this.b = b;
}
public String getA() {
return a;
}
public void setA(String a) {
this.a = a;
}
public String getB() {
return b;
}
public void setB(String b) {
this.b = b;
}
}
//######### another program A####
package servlet_A;
import beanpackage.JavaBean;
private void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
JavaBean bean = new JavaBean(request.getParameter("a"),request.getPara meter("b"));
//more codes
}
//######### another program B####
package servlet_B;
import beanpackage.JavaBean;
private void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
JavaBean bean = new JavaBean(request.getParameter("c"),request.getPara meter("d"));
//more codes
}
im worried that program B might change the data for program A or vise-versa or when program A stores its data to bean and program B is retrieving its data from bean.. program B will retrieve data from A.. are these instances possible ?Last edited by anthrax; 01-27-2010 at 06:39 AM.
- 01-27-2010, 10:20 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 26
Similar Threads
-
How to pass user-id between .java programs
By mkkrish in forum AWT / SwingReplies: 4Last Post: 12-22-2009, 05:30 PM -
Java Programs to Test Performance
By testarosa in forum Advanced JavaReplies: 4Last Post: 02-27-2009, 02:04 PM -
Running 3 Java programs in sequence.
By loktamu in forum New To JavaReplies: 2Last Post: 11-23-2008, 07:50 PM -
application is not running please fine the solution for it.
By jagadeeshchinni in forum New To JavaReplies: 4Last Post: 09-28-2008, 11:14 AM -
Problem in running java programs
By aravind in forum New To JavaReplies: 0Last Post: 07-14-2008, 12:19 PM
Bookmarks