Two Laptop Bag*
The moose likes BEA/Weblogic and the fly likes Works with Tomcat but not weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Works with Tomcat but not weblogic" Watch "Works with Tomcat but not weblogic" New topic
Author

Works with Tomcat but not weblogic

Glenn Rogers
Greenhorn

Joined: Apr 24, 2009
Posts: 6
I am migrating an application from Tomcat to Weblogic 10gr3 but I am getting the following error. The tomcat error occurred after upgrading to 6.x, which I resolved using the params below. However, I am not able to find a similar fix for weblogic. It may not be related. But searching the net it suggested using a backslash to separate the string that has double quotes which apparently not allowed. Any ideas what is wrong? Full code listed below.

############CODE SNIPPET######################
attr.put("p_email",mrequest.getParameter("p_email"));

I tried using backslash at the end but that didnt work. full code below
attr.put("p_email",mrequest.getParameter(\"p_email\"));

############TOMCAT ERROR######################
Attribute value mrequest.getParameter("p_email") is quoted with " which must be escaped

############TOMCAT FIX########################
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

###########WEBLOGIC ERROR##################
Compilation of JSP File '/process.jsp' failed:
process.jsp:1148:61: p_email cannot be resolved
<jsp:param name="email" value="<%=mrequest.getParameter(p_email)%>"/>
^----^
process.jsp:1164:61: p_email cannot be resolved
<jsp:param name="email" value="<%=mrequest.getParameter(p_email)%>"/>

^----^
###########full code process.jp########################
<%
/**
*
*
*
*/
%>
<%@ page language="java" contentType="text/html" import="java.util.*,common.*"%>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="javazoom.upload.*" %>
<%@ page import="form.*" %>
<%
HttpSession HSS = request.getSession();
HashMap attr = null;
registration rg = null;
agentRegistration rg1 = null;

// register1 variables
String firstName = "";
String lastName = "";
String email = "";
String password1 = "";
String password2 = "";
String password3 = "";

String selZip = "";
// resister2 variables

String myself = "";
String arr_myself[] = null;
boolean error = false;
boolean status = false;
boolean error1 = false;

// resister3 variables

String sex = "";
String experience = "";
String arrCommission[] = null;
String commission = "";
String arrIndustry[] = null;
String industry = "";
String arrEducation[] = null;
String education = "";
String arrSpecialize[] = null;
String specialize = "";
String languages = "";
String email_receipt = "";
String university = "";
String arrCertificate[] = null;
String certificate = "";
String licenseNo = "";

// changePassword variables

String userID = "";
String oldPassword = "";
String newPassword1 = "";
String newPassword2 = "";

// login variables

String userId = "";
String password = "";

// agentregister1 variables
String agent = "";
String office = "";
String mobile = "";

String fileName = "";
String fileName1 = "";

String state = "";
String city = "";
String address = "";
// Modified in phase 5
String zipcode = "";
String distance = "";
String noimage = "";
String userMode1 = "";
String noLogo = "";
String description = "";

String li_ag_id = "";
String li_listPrice = "";
String li_bedrooms = "";
String li_baths = "";
String li_sqFt = "";
String li_city = "";
String listingId = "";
String li_fileName = "";
String li_desc = "";

MultipartFormDataRequest mrequest = null;

MATResourceBundle bundle = new MATResourceBundle("FORMS");
MATResourceBundle errBundle = new MATResourceBundle("ERROR");

String modeValue = "";

if(request.getParameter("mode")!=null){
modeValue = request.getParameter("mode").trim();
}
if(MultipartFormDataRequest.isMultipartFormData(request)){


mrequest = new MultipartFormDataRequest(request);
modeValue = mrequest.getParameter("mode");
}
%>
<jsp:useBean id="agentListing" class="common.AgentListing"/>
<jsp:useBean id="userRegisterHandler" class="form.userRegisterBean" scope="request">
<jsp:setProperty name="userRegisterHandler" property="*"/>
</jsp:useBean>
<jsp:useBean id="agentRegisterHandler" class="form.agentRegisterBean" scope="request">
<jsp:setProperty name="agentRegisterHandler" property="*"/>
</jsp:useBean>
<jsp:useBean id="upBean" scope="request" class="javazoom.upload.UploadBean" >
<jsp:setProperty name="upBean" property="folderstore" value="<%=bundle.getKeyValue(\"upload_path\")%>" />
<jsp:setProperty name="upBean" property="filesizelimit" value="1572864" />
</jsp:useBean>
<% if (modeValue.equals("SERVICES")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"SERVICES\")%>"/><% }
else if (modeValue.equals("AGE_LOGIN")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"AGE_LOGIN\")%>"/><% }
else if (modeValue.equals("CONTACTUS")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"CONTACTUS\")%>"/><% }
else if (modeValue.equals("USR_REGISTER")){
if (request.getParameter("registerMode")!= null){
HSS.setAttribute("USER_MODE",request.getParameter("registerMode")); }
HSS.setAttribute("error","");%>
<jsp:forward page="<%=bundle.getKeyValue(\"USR_REGISTER\")%>"/><%}
else if (modeValue.equals("register1")){
attr = new HashMap();
if (request.getParameter("sex")!=null){
sex = request.getParameter("sex");
}

if (request.getParameter("userMode1")!=null){
userMode1 = request.getParameter("userMode1");
}

if (request.getParameter("city")!=null){
city = request.getParameter("city");
}

if(request.getParameter("experience")!=null){
experience = request.getParameter("experience");
}
if(request.getParameterValues("commission")!= null) {
commission = request.getParameter("commission");

}
if(request.getParameterValues("industry")!= null) {
arrIndustry = request.getParameterValues("industry");
for (int i=0;i<arrIndustry.length;i++){
if (industry.equals("")){
industry = arrIndustry[i];
}else{
industry = industry + "|" + arrIndustry[i];
}
}
}
if(request.getParameterValues("education")!= null) {
education = request.getParameter("education");

}
if(request.getParameterValues("specialize")!= null) {
arrSpecialize = request.getParameterValues("specialize");
for (int i=0;i<arrSpecialize.length;i++){
if (specialize.equals("")){
specialize = arrSpecialize[i];
}else{
specialize = specialize + "|" + arrSpecialize[i];
}
}
}
if(request.getParameter("languages")!=null){
languages = request.getParameter("languages");
}
if(request.getParameter("email_receipt")!=null){
email_receipt = request.getParameter("email_receipt");
}
String errString = "";
HSS.removeAttribute("mode");
HSS.setAttribute("mode","processreg1");
HSS.setAttribute("first_name",userRegisterHandler.getFirstname());
HSS.setAttribute("last_name",userRegisterHandler.getLastname());
HSS.setAttribute("email",userRegisterHandler.getEmail());
HSS.setAttribute("password1",userRegisterHandler.getPassword1());
HSS.setAttribute("password2",userRegisterHandler.getPassword2());
HSS.setAttribute("sel_zip",userRegisterHandler.getTxtsel_zip());
HSS.setAttribute("city",city);

Boolean B = (Boolean)session.getAttribute( "PassedCaptcha" );
if ( B!=null && B.booleanValue() )
{}
else {System.out.print("\n\n"+errBundle.getKeyValue("captcha.error")+"\n\n");
HSS.setAttribute("errorMessage",errBundle.getKeyValue("captcha.error"));
%>
<jsp:forward page="<%=bundle.getKeyValue(\"process.resister1\")%>"/><%
}

attr.put("sex",sex);
attr.put("experience",experience);
attr.put("commission",commission);
attr.put("industry",industry);
attr.put("education",education);
attr.put("specialize",specialize);
attr.put("languages",languages);
attr.put("email_receipt",email_receipt);
attr.put("userMode",userMode1);
attr.put("city",city);

if(HSS.getAttribute("first_name")!= null){
firstName = (String)HSS.getAttribute("first_name");
}
if(HSS.getAttribute("last_name")!= null){
lastName = (String)HSS.getAttribute("last_name");
}
if(HSS.getAttribute("email")!= null){
email = (String)HSS.getAttribute("email");
}
if(HSS.getAttribute("password1")!= null){
password1 = (String)HSS.getAttribute("password1");
}
if(HSS.getAttribute("sel_zip")!= null){
selZip = (String)HSS.getAttribute("sel_zip");
}
if(HSS.getAttribute("traits")!= null){
myself = (String)HSS.getAttribute("traits");
}

if(userMode1.equals("buying"))
selZip = "00000";
attr.put("first_name",firstName);
attr.put("last_name",lastName);
attr.put("email",email);
EncryptionUtil ob = new EncryptionUtil();
password1 = ob.encrypt(password1);
attr.put("password1",password1);
attr.put("sel_zip",selZip);
// resister3 variable
attr.put("traits",myself);


if(userRegisterHandler.validateUserRegister1()){
HSS.setAttribute("mode","processreg1");
try{
rg = new registration();
error = rg.checkUserOccurance(userRegisterHandler.getEmail(),"Real_State");
if(!error)
error1 = rg.registerUser(attr,"Real_State");
}catch(Exception ex){

error = true;
}
finally{
attr = null;
rg = null;
}
if(error){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.duplicat_emailid")); %>
<jsp:forward page="<%=bundle.getKeyValue(\"process.resister1\")%>"/><% }else if(error1){%>
<jsp:forward page="error.htm"/><%}else{
HSS.removeAttribute("mode");
// In phase 4 it is redirected to userRegisterTwo.jsp ie., process.resister2
HSS.invalidate();
HSS = null;
HSS = request.getSession();
HSS.setAttribute("email",email);
HSS.setAttribute("fname",userRegisterHandler.getFirstname());
%>
<jsp:forward page="<%=bundle.getKeyValue(\"registeration.success\")%>"/><% }
}else{ %>
<jsp:forward page="<%=bundle.getKeyValue(\"process.resister1\")%>"/><% }
// This Block is not necessary It is unreachable block
}

else if (modeValue.equals("updateUserInfo")){
attr = new HashMap();
attr.put("usr_status", "A");
if (request.getParameter("userMode1")!=null){
userMode1 = request.getParameter("userMode1");
}
if(request.getParameterValues("city")!= null) {
city = request.getParameter("city");
}

if(request.getParameter("email_receipt")!=null){
email_receipt = request.getParameter("email_receipt");
}
String errString = "";
HSS.removeAttribute("mode");
HSS.setAttribute("first_name",userRegisterHandler.getFirstname());
HSS.setAttribute("last_name",userRegisterHandler.getLastname());
HSS.setAttribute("email",userRegisterHandler.getEmail());
HSS.setAttribute("password1",userRegisterHandler.getPassword1());
HSS.setAttribute("password2",userRegisterHandler.getPassword2());
HSS.setAttribute("sel_zip",userRegisterHandler.getTxtsel_zip());


if(!HSS.getAttribute("usr_email").equals(HSS.getAttribute("email"))) {

rg1 = new agentRegistration();
HSS.setAttribute("mode","processreg1");
if(rg1.checkAgentOccurance((String)HSS.getAttribute("email"), "Real_State")) {
HSS.setAttribute("errorMessage","This email id is already present. Please select another Id");
%>
<jsp:forward page="<%=bundle.getKeyValue(\"user.updateInfo\")%>"/><%
} else {
attr.put("usr_status", "I");
status = true;
}
}
attr.put("email_receipt",email_receipt);
attr.put("userMode",userMode1);
attr.put("city",city);

if(HSS.getAttribute("first_name")!= null){
firstName = (String)HSS.getAttribute("first_name");
}
if(HSS.getAttribute("last_name")!= null){
lastName = (String)HSS.getAttribute("last_name");
}
if(HSS.getAttribute("email")!= null){
email = (String)HSS.getAttribute("email");
}
if(HSS.getAttribute("password1")!= null){
password1 = (String)HSS.getAttribute("password1");
}
if(HSS.getAttribute("sel_zip")!= null){
selZip = (String)HSS.getAttribute("sel_zip");
}
if(HSS.getAttribute("traits")!= null){
myself = (String)HSS.getAttribute("traits");
}

if(userMode1.equals("buying"))
selZip = "00000";
attr.put("first_name",firstName);
attr.put("last_name",lastName);
attr.put("email",request.getParameter("email"));
EncryptionUtil ob = new EncryptionUtil();
password1 = ob.encrypt(password1);
attr.put("password1",password1);
attr.put("sel_zip",selZip);
attr.put("traits",myself);
attr.put("oldEmail",(String) HSS.getAttribute("usr_email"));


if(userRegisterHandler.validateUserRegister1()){
HSS.setAttribute("mode","processreg1");
try{
rg = new registration();
error1 = rg.updateUser(attr,"Real_State");
}catch(Exception ex){

error = true;
}
finally{
attr = null;
rg = null;
}
if(error){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.duplicat_emailid")); %>
<jsp:forward page="<%=bundle.getKeyValue(\"user.updateInfo\")%>"/><% }else if(error1){%>
<jsp:forward page="error.htm"/><%}else{
HSS.removeAttribute("mode");

// In phase 4 it is redirected to userRegisterTwo.jsp ie., process.resister2
if(!status) {
%>
<jsp:forward page="<%=bundle.getKeyValue(\"user.home\")%>"/>
<%
} else {
HSS.invalidate();
HSS = null;
HSS = request.getSession();
HSS.setAttribute("email",email);
HSS.setAttribute("fname", firstName);
%>
<jsp:forward page="<%=bundle.getKeyValue(\"updation.success\")%>"/>
<%

}

}
}else{
%>
<jsp:forward page="<%=bundle.getKeyValue(\"user.updateInfo\")%>"/><% }
// This Block is not necessary It is unreachable block
}

else if (modeValue.equals("CHANGECRITERIA")){
attr = new HashMap();
if (request.getParameter("sex")!=null){
sex = request.getParameter("sex");
}
if(request.getParameter("experience")!=null){
experience = request.getParameter("experience");
}
if(request.getParameterValues("commission")!= null) {
commission = request.getParameter("commission");
}
if(request.getParameterValues("industry")!= null) {
arrIndustry = request.getParameterValues("industry");
for (int i=0;i<arrIndustry.length;i++){
if (industry.equals("")){
industry = arrIndustry[i];
}else{
industry = industry + "|" + arrIndustry[i];
}
}
}
if(request.getParameterValues("education")!= null) {
education = request.getParameter("education");
}
if(request.getParameterValues("specialize")!= null) {
arrSpecialize = request.getParameterValues("specialize");
for (int i=0;i<arrSpecialize.length;i++){
if (specialize.equals("")){
specialize = arrSpecialize[i];
}else{
specialize = specialize + "|" + arrSpecialize[i];
}
}
}
if(request.getParameter("languages")!=null){
languages = request.getParameter("languages");
}
String errString = "";
HSS.removeAttribute("mode");

attr.put("sex",sex);
attr.put("experience",experience);
attr.put("commission",commission);
attr.put("industry",industry);
attr.put("education",education);
attr.put("specialize",specialize);
attr.put("languages",languages);
attr.put("oldEmail",request.getParameter("oldEmail"));
try{
rg = new registration();
error1 = rg.updateAgentCriteria(attr,"Real_State");
}catch(Exception ex){
error = true;
System.out.print("Exception=>"+ex);
}
finally{
attr = null;
rg = null;
}
if(error){%>
<jsp:forward page="<%=bundle.getKeyValue(\"user.changeCriteria\")%>"/><%
}else if(error1){%>
<jsp:forward page="error.htm"/><%
}else{
HSS.removeAttribute("mode");%>
<jsp:forward page="<%=bundle.getKeyValue(\"user.home\")%>"/><%
}
}

else if (modeValue.equals("changePassword")){
if(userRegisterHandler.validateUserId()){
if(request.getParameter("old_password") != null){
oldPassword = request.getParameter("old_password").trim();
EncryptionUtil ob = new EncryptionUtil();
oldPassword = ob.encrypt(oldPassword);

}
if(request.getParameter("new_password1") != null){
newPassword1 = request.getParameter("new_password1").trim();
EncryptionUtil ob = new EncryptionUtil();
newPassword1 = ob.encrypt(newPassword1);
}
if(request.getParameter("new_password2") != null){
newPassword2 = request.getParameter("new_password2").trim();
EncryptionUtil ob = new EncryptionUtil();
newPassword2 = ob.encrypt(newPassword2);
}

userID = (String) HSS.getAttribute("usr_email");

try{
rg = new registration();
error = rg.validateUser(userID,oldPassword,"Real_State");
if(error){
error = rg.updateUserPassword(userID,newPassword1,"Real_State");
System.out.print(error);
if(error){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passwordchangesuccess"));
}else{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passworderror"));
}
}else{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.invalidpassword"));
}
}catch(Exception ex){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passworderror"));
}
} %>
<jsp:forward page="<%=bundle.getKeyValue(\"changepassword.retry\")%>"/><% }

else if (modeValue.equals("Home")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"Home\")%>"/><% }
else if (modeValue.equals("Services")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"Services\")%>"/><% }
else if (modeValue.equals("AgentsLogin")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"AgentsLogin\")%>"/><% }
else if (modeValue.equals("ContactUs")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"ContactUs\")%>"/><% }
else if (modeValue.equals("UVA")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"UVA\")%>"/><% }
else if (modeValue.equals("userLogin")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"user.login\")%>"/><% }
else if (modeValue.equals("URO")){
if(request.getParameter("USER_MODE") != null){
String tempUserMode = request.getParameter("USER_MODE");
HSS.setAttribute("USER_MODE",tempUserMode);
}%>
<jsp:forward page="<%=bundle.getKeyValue(\"process.resister1\")%>"/><% }

else if (modeValue.equals("agentresister1")){%>
<% agentRegisterBean agentBean = new agentRegisterBean();

if(MultipartFormDataRequest.isMultipartFormData(request)){

firstName = mrequest.getParameter("firstName");
lastName = mrequest.getParameter("lastName");
email = mrequest.getParameter("email");
password1 = mrequest.getParameter("password1");
password2 = mrequest.getParameter("password2");
agent = mrequest.getParameter("agent");
office = mrequest.getParameter("office");
fileName = mrequest.getParameter("filename");
state = mrequest.getParameter("state");
zipcode = mrequest.getParameter("zipcode");
distance = mrequest.getParameter("distance");
city = mrequest.getParameter("city");
university = mrequest.getParameter("ag_university");
certificate = mrequest.getParameter("ag_certificate");
licenseNo = mrequest.getParameter("license_no");

if(mrequest.getParameter("noimage")!=null)
{
noimage = mrequest.getParameter("noimage");
}
else
noimage ="N";
if (mrequest.getParameter("sex")!=null){
sex = mrequest.getParameter("sex");
}
if(mrequest.getParameter("experience")!=null){
experience = mrequest.getParameter("experience");
}
if(mrequest.getParameterValues("commission")!= null) {
commission = mrequest.getParameter("commission");
}
if(mrequest.getParameterValues("industry")!= null) {
arrIndustry = mrequest.getParameterValues("industry");
for (int i=0;i<arrIndustry.length;i++){
if (industry.equals("")){
industry = arrIndustry[i];
}else{
industry = industry + "|" + arrIndustry[i];
}
}
}
if(mrequest.getParameterValues("education")!= null) {
education = mrequest.getParameter("education");
}
if(mrequest.getParameterValues("specialize")!= null) {
arrSpecialize = mrequest.getParameterValues("specialize");
for (int i=0;i<arrSpecialize.length;i++){
if (specialize.equals("")){
specialize = arrSpecialize[i];
}else{
specialize = specialize + "|" + arrSpecialize[i];
}
}
}
if(mrequest.getParameter("languages")!=null){
languages = mrequest.getParameter("languages");
}
if(mrequest.getParameter("email_receipt")!=null){
email_receipt = mrequest.getParameter("email_receipt");
}


// Default value for the no image is Y for database insertion process we are changing it to N
if(!noimage.equals("Y")){
noimage = "N";
}


agentBean.setFirstName(firstName);
agentBean.setLastName(lastName);
agentBean.setEmail(email);
agentBean.setPassword1(password1);
agentBean.setPassword2(password2);
agentBean.setAgent(agent);
agentBean.setOffice(office);
agentBean.setState(state);
agentBean.setZipcode(zipcode);
agentBean.setDistance(distance);
agentBean.setNoimage(noimage);
agentBean.setCity(city);


HSS.removeAttribute("mode");
HSS.setAttribute("ag_firstName",firstName);
HSS.setAttribute("ag_lastName",lastName);
HSS.setAttribute("ag_email",email);
HSS.setAttribute("ag_password",password1);
HSS.setAttribute("ag_brokerage",agent);
HSS.setAttribute("ag_office",office);
HSS.setAttribute("ag_filename",fileName);
HSS.setAttribute("ag_state",state);
HSS.setAttribute("ag_city",city);
// Depricated from the phase 4
HSS.setAttribute("ag_zipcode",zipcode);
HSS.setAttribute("ag_distance",distance);
HSS.setAttribute("ag_noimage",noimage);
HSS.setAttribute("ag_university",university);
HSS.setAttribute("ag_certificate",certificate);
HSS.setAttribute("ag_licenseNo",licenseNo);
HSS.setAttribute("mode","processreg1");

// this is depricated from phase4

Boolean B = (Boolean)session.getAttribute( "PassedCaptcha" );
if ( B!=null && B.booleanValue() )
{}
else {System.out.print("\n\n"+errBundle.getKeyValue("captcha.error")+"\n\n");
HSS.setAttribute("errorMessage",errBundle.getKeyValue("captcha.error"));
%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.process.resister1\")%>"/><%
}


}

if(agentBean.validateUser()){
rg1 = new agentRegistration();
error = rg1.checkAgentOccurance(email,"Real_State");
HSS.setAttribute("mode","processreg1");
if(!error){
try{
Hashtable files = mrequest.getFiles();
System.out.print("hiii");
if ( (files != null) || (!files.isEmpty())){
UploadFile file = (UploadFile) files.get("uploadfile");
upBean.store(mrequest, "uploadfile");
System.out.println("<li>uploaded files");
}else{
System.out.println("<li>No uploaded files");
}
attr = new HashMap();
attr.put("ag_sex",sex);
attr.put("ag_experience",experience);
attr.put("ag_commission",commission);
attr.put("ag_industry",industry);
attr.put("ag_education",education);
attr.put("ag_specialize",specialize);
attr.put("ag_languages",languages);
attr.put("ag_firstName",firstName);
attr.put("ag_lastName",lastName);
attr.put("ag_email",email);
attr.put("ag_city",city);
password3 = password1;
EncryptionUtil ob = new EncryptionUtil();
password1 = ob.encrypt(password1);
attr.put("ag_password",password1);
attr.put("ag_brokerage",agent);
attr.put("ag_office",office);
attr.put("ag_traits",myself);
attr.put("ag_filename",fileName);
attr.put("ag_state",state);
attr.put("ag_zipcode",zipcode);
attr.put("ag_distance",distance);
attr.put("ag_noimage",noimage);
attr.put("ag_university",university);
attr.put("ag_certificate",certificate);
attr.put("ag_licenseNo",licenseNo);

rg1 = new agentRegistration();
error = rg1.resisterAgent(attr,"Real_State");
if(error){

%>
<jsp:forward page="error.htm"/>
<%
}
}catch(Exception e){
error = true;
String exc = ""+e;
if(exc.indexOf("Upload file size limit reached ")!=-1) {
HSS.setAttribute("errorMessage",errBundle.getKeyValue("upload.limit"));
}
else {
HSS.setAttribute("errorMessage",errBundle.getKeyValue("admin.error"));
}
System.out.println("exception : : "+e.getMessage());
%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.process.resister1\")%>"/>
<%
}
// In the phase4 this page is redirected to agent.process.resister2
HSS.invalidate();
HSS = null;
HSS = request.getSession();
HSS.setAttribute("email",email);
HSS.setAttribute("fname",firstName);
%>
<jsp:forward page="<%=bundle.getKeyValue(\"registeration.success\")%>">
<jsp:param name="email" value="<%=email%>"/>
<jsp:param name="password" value="<%=password3%>"/>
</jsp:forward>
<% }else{
HSS.setAttribute("errorMessage","This email id is already present. Please select another Id");
%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.process.resister1\")%>"/><%
}
}else{
HSS.setAttribute("agent_bean",agentBean);%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.process.resister1\")%>"/><% }
}


else if (modeValue.equals("updateAgentInfo")){%>
<%
agentRegisterBean agentBean = new agentRegisterBean();

if(MultipartFormDataRequest.isMultipartFormData(request)){

firstName = mrequest.getParameter("firstName");
lastName = mrequest.getParameter("lastName");
email = mrequest.getParameter("email");
password1 = mrequest.getParameter("password1");
password2 = mrequest.getParameter("password2");
agent = mrequest.getParameter("agent");
office = mrequest.getParameter("office");
fileName = mrequest.getParameter("filename");
state = mrequest.getParameter("state");
zipcode = mrequest.getParameter("zipcode");
distance = mrequest.getParameter("distance");
city = mrequest.getParameter("city");
licenseNo = mrequest.getParameter("license_no");

if (mrequest.getParameter("sex")!=null){
sex = mrequest.getParameter("sex");
}
if(mrequest.getParameter("experience")!=null){
experience = mrequest.getParameter("experience");
}
if(mrequest.getParameterValues("commission")!= null) {
commission = mrequest.getParameter("commission");
}
if(mrequest.getParameterValues("industry")!= null) {
arrIndustry = mrequest.getParameterValues("industry");
for (int i=0;i<arrIndustry.length;i++){
if (industry.equals("")){
industry = arrIndustry[i];
}else{
industry = industry + "|" + arrIndustry[i];
}
}
}

if(mrequest.getParameterValues("specialize")!= null) {
arrSpecialize = mrequest.getParameterValues("specialize");
for (int i=0;i<arrSpecialize.length;i++){
if (specialize.equals("")){
specialize = arrSpecialize[i];
}else{
specialize = specialize + "|" + arrSpecialize[i];
}
}
}
if(mrequest.getParameter("languages")!=null){
languages = mrequest.getParameter("languages");
}
if(mrequest.getParameter("email_receipt")!=null){
email_receipt = mrequest.getParameter("email_receipt");
}


// Default value for the no image is Y for database insertion process we are changing it to N
if(!noimage.equals("Y")){
noimage = "N";
}


agentBean.setFirstName(firstName);
agentBean.setLastName(lastName);
agentBean.setEmail(email);
agentBean.setPassword1(password1);
agentBean.setPassword2(password2);
agentBean.setAgent(agent);
agentBean.setOffice(office);
agentBean.setState(state);
agentBean.setZipcode(zipcode);
agentBean.setDistance(distance);
agentBean.setNoimage(noimage);
agentBean.setCity(city);

HSS.removeAttribute("mode");
HSS.setAttribute("ag_firstName",firstName);
HSS.setAttribute("ag_lastName",lastName);
HSS.setAttribute("ag_email",email);
HSS.setAttribute("ag_password",password1);
HSS.setAttribute("ag_brokerage",agent);
HSS.setAttribute("ag_office",office);
HSS.setAttribute("ag_filename",fileName);
HSS.setAttribute("ag_state",state);
HSS.setAttribute("ag_city",city);
// Depricated from the phase 4
HSS.setAttribute("ag_zipcode",zipcode);
HSS.setAttribute("ag_distance",distance);
HSS.setAttribute("email",mrequest.getParameter("oldEmail"));


// this is depricated from phase4




}

if(agentBean.validateUser()){
rg1 = new agentRegistration();

HSS.setAttribute("mode","processreg1");
if(!error){
try{
attr = new HashMap();
attr.put("ag_status", "A");
if(!mrequest.getParameter("oldEmail").equals(mrequest.getParameter("email"))) {

rg1 = new agentRegistration();
if(rg1.checkAgentOccurance(mrequest.getParameter("email"), "Real_State")) {
HSS.setAttribute("errorMessage","This email id is already present. Please select another Id");
%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.updateinfo\")%>"/><%
} else {
attr.put("ag_status", "I");
status = true;
}
}
email = mrequest.getParameter("email");
attr.put("ag_sex",sex);
attr.put("ag_experience",experience);
attr.put("ag_commission",commission);
attr.put("ag_industry",industry);
attr.put("ag_specialize",specialize);
attr.put("ag_languages",languages);
attr.put("ag_firstName",firstName);
attr.put("ag_lastName",lastName);
attr.put("ag_email",email);
attr.put("ag_city",city);

password3 = password1;
EncryptionUtil ob = new EncryptionUtil();
password1 = ob.encrypt(password1);
attr.put("ag_password",password1);
attr.put("ag_brokerage",agent);
attr.put("ag_office",office);
attr.put("ag_traits",myself);
attr.put("ag_filename",fileName);
attr.put("ag_state",state);
attr.put("ag_zipcode",zipcode);
attr.put("ag_distance",distance);
attr.put("ag_noimage",noimage);
attr.put("email",mrequest.getParameter("oldEmail"));
attr.put("ag_licenseNo",licenseNo);
rg1 = new agentRegistration();

error = rg1.updateAgent(attr,"Real_State");

if(error){
%>
<jsp:forward page="error.htm"/>
<%
}


}catch(Exception e){
error = true;
System.out.println("Exception => "+e.getMessage());
}

// In the phase4 this page is redirected to agent.process.resister2

if(!status) {
%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.updateinfo.success\")%>"/>
<%
} else {
HSS.invalidate();
HSS = null;
HSS = request.getSession();
HSS.setAttribute("email",email);
HSS.setAttribute("fname", mrequest.getParameter("firstName"));
%>
<jsp:forward page="<%=bundle.getKeyValue(\"updation.success\")%>"/>
<%

}

} else{
HSS.setAttribute("errorMessage","This email id is already present. Please select another Id");
%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.updateinfo\")%>"/><%
}
}else{
HSS.setAttribute("agent_bean",agentBean);%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.updateinfo\")%>"/><% }
}


else if (modeValue.equals("AgchangePassword")){
if(agentRegisterHandler.validateAgentPass()){
if(request.getParameter("old_password") != null){
oldPassword = request.getParameter("old_password").trim();
EncryptionUtil ob = new EncryptionUtil();
oldPassword = ob.encrypt(oldPassword);
}
if(request.getParameter("new_password1") != null){
newPassword1 = request.getParameter("new_password1").trim();
EncryptionUtil ob = new EncryptionUtil();
newPassword1 = ob.encrypt(newPassword1);
}
if(request.getParameter("new_password2") != null){
newPassword2 = request.getParameter("new_password2").trim();
//EncryptionUtil ob = new EncryptionUtil();
//new_password2 = ob.encrypt(new_password2);
}

userID = (String) HSS.getAttribute("usr_email");

try{
rg1 = new agentRegistration();
error = rg1.validateAgentPass(userID,oldPassword,"Real_State");
if(error){
error = rg1.updateAgentPassword(userID,newPassword1,"Real_State");
if(error){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passwordchangesuccess"));
}else{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passworderror"));
}
}else{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.invalidpassword"));
}
}catch(Exception ex){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passworderror"));
}
} %>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.changepassword.retry\")%>"/><% }
else if (modeValue.equals("ARO")){ %>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.process.resister1\")%>"/><% }else if (modeValue.equals("AgentsLogin")) { %>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.login.retry\")%>"/><% }

if (modeValue.equals("login")){
try{
{
if(request.getParameter("userid") != null){
userId = request.getParameter("userid").trim();
}
if(request.getParameter("password") != null){
password = request.getParameter("password").trim();
EncryptionUtil ob = new EncryptionUtil();
password = ob.encrypt(password);
}
rg = new registration();
error = rg.validateUser(userId,password,"Real_State");

if(error){
String[] usr = rg.getUserName(userId,"Real_State");
String usr_name = usr[0] + " " + usr[1];
//HSS = null;
Cookie userCookieUsername = new Cookie("username", usr[0]);
userCookieUsername.setMaxAge(-1);
userCookieUsername.setPath("/");

response.addCookie(userCookieUsername);

Cookie userCookiePassword = new Cookie("password", password);
userCookiePassword.setMaxAge(-1);
userCookiePassword.setPath("/");
response.addCookie(userCookiePassword);

Cookie userCookieEmail = new Cookie("email", userId);
userCookieEmail.setMaxAge(-1);
userCookieEmail.setPath("/");
response.addCookie(userCookieEmail);
HSS = request.getSession();
HSS.setAttribute("usr_email",userId);
HSS.setAttribute("usr_name",usr_name);
HSS.setAttribute("usr","user");
HSS.removeAttribute("errorMessage");
int countSelectedAgent = rg.countSelectedAgents("Real_State",userId);
if(countSelectedAgent>0)
response.sendRedirect("userHome.jsp");
else
response.sendRedirect(bundle.getKeyValue("login.success"));
}else{
rg1 = new agentRegistration();
error = rg1.validateAgentPass(userId,password,"Real_State");
if(error){
String[] usr = rg1.getUserName(userId,"Real_State");
String usr_name = usr[0] + " " + usr[1];
Cookie agentCookieUsername = new Cookie("username", usr[0]);
agentCookieUsername.setMaxAge(-1);
agentCookieUsername.setPath("/");
response.addCookie(agentCookieUsername);

Cookie agentCookiePassword = new Cookie("password", password);
agentCookiePassword.setMaxAge(-1);
agentCookiePassword.setPath("/");
response.addCookie(agentCookiePassword);

Cookie agentCookieEmail = new Cookie("email", userId);
agentCookieEmail.setMaxAge(-1);
agentCookieEmail.setPath("/");
response.addCookie(agentCookieEmail);
//HSS = null;
HSS = request.getSession();
HSS.setAttribute("usr_email",userId);
HSS.setAttribute("usr_name",usr_name);
HSS.setAttribute("usr","agent");
HSS.removeAttribute("errorMessage");
response.sendRedirect(bundle.getKeyValue("agent.login.success"));
}
else{

professionalRegistration rg2 = new professionalRegistration();
error = rg2.validateUser(userId,password,"Real_State");
if(error)
{
String[] usr = rg2.getUserName(userId,"Real_State");
String usr_name = usr[0] + " " + usr[1];
Cookie professionalCookieUsername = new Cookie("username", usr[0]);
professionalCookieUsername.setMaxAge(-1);
professionalCookieUsername.setPath("/");
response.addCookie(professionalCookieUsername);

Cookie professionalCookiePassword = new Cookie("password", password);
professionalCookiePassword.setMaxAge(-1);
professionalCookiePassword.setPath("/");
response.addCookie(professionalCookiePassword);

Cookie professionalCookieEmail = new Cookie("email", userId);
professionalCookieEmail.setMaxAge(-1);
professionalCookieEmail.setPath("/");
response.addCookie(professionalCookieEmail);
//HSS = null;
HSS = request.getSession();
HSS.setAttribute("usr_email",userId);
HSS.setAttribute("usr_name",usr_name);
HSS.setAttribute("usr","professional");
HSS.removeAttribute("errorMessage");
response.sendRedirect(bundle.getKeyValue("professional.login.success"));
}else{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("login.invalid_password"));
%>
<jsp:forward page="<%=bundle.getKeyValue(\"login.retry\")%>"/><%}}}

}

}catch(Exception e){
out.println("Error is " + e.getMessage());
}
}

//***************************************START PROFESSIONAL*********************************************************************//
//professional registration
if(modeValue.equals("PROFESSIONAL_REGISTER"))
{
try
{
if(MultipartFormDataRequest.isMultipartFormData(request)){
firstName = mrequest.getParameter("fname");
lastName = mrequest.getParameter("lname");
password1 = mrequest.getParameter("p_password");
office = mrequest.getParameter("office");
address = mrequest.getParameter("p_address");
state = mrequest.getParameter("state");
zipcode = mrequest.getParameter("p_zip");
city = mrequest.getParameter("p_city");
fileName = mrequest.getParameter("filename");
fileName1 = mrequest.getParameter("filename1");
if(mrequest.getParameter("noimage")!=null) {
noimage = mrequest.getParameter("noimage");
}
else
noimage ="Y";
if(mrequest.getParameter("noLogo")!=null) {
noLogo = mrequest.getParameter("noLogo");
}
else
noLogo ="Y";

Hashtable files = mrequest.getFiles();
if ( (files != null) || (!files.isEmpty())){
UploadFile file = (UploadFile) files.get("uploadfile");
upBean.store(mrequest, "uploadfile");
UploadFile file1 = (UploadFile) files.get("uploadfile1");
upBean.store(mrequest, "uploadfile1");
System.out.println("<li>uploaded files");
}else{
System.out.println("<li>No uploaded files");
}

attr = new HashMap();
EncryptionUtil ob = new EncryptionUtil();
password1 = ob.encrypt(password1);
attr.put("p_fname",firstName);
attr.put("p_lname",lastName);
attr.put("p_password",password1);
attr.put("p_phone",office);
attr.put("p_address",address);
attr.put("p_city",city);
attr.put("p_state",state);
attr.put("p_zip",zipcode);
attr.put("p_noImage",noimage);
attr.put("p_noLogo",noLogo);
attr.put("p_email",mrequest.getParameter("p_email"));
attr.put("p_imageName",fileName);
attr.put("p_logoName",fileName1);

professionalRegistration rg2 = new professionalRegistration();
error = rg2.resisterProfessional(attr,"Real_State");


if(!error) {
HSS = request.getSession();
HSS.removeAttribute("errorMessage");
HSS.setAttribute("usr_email",mrequest.getParameter("p_email"));
HSS.setAttribute("usr_name",mrequest.getParameter("fname") + mrequest.getParameter("lname"));
HSS.setAttribute("usr","professional");
response.sendRedirect(bundle.getKeyValue("professional.login.success"));
}
else {
%>
<jsp:forward page="joinNetwork.jsp">
<jsp:param name="email" value="<%=mrequest.getParameter(p_email)%>"/>
</jsp:forward>
<%
}
} // end if(MultipartFormDataRequest.isMultipartFormData(request)){
}//end try
catch(Exception e) {
String exc = ""+e;
if(exc.indexOf("Upload file size limit reached ")!=-1) {
HSS.setAttribute("errorMessage",errBundle.getKeyValue("upload.limit"));
}
else {
HSS.setAttribute("errorMessage",errBundle.getKeyValue("admin.error"));
}
%>
<jsp:forward page="joinNetwork.jsp">
<jsp:param name="email" value="<%=mrequest.getParameter(p_email)%>"/>
</jsp:forward>
<%
}//end catch
}//end if(modeValue.equals("PROFESSIONAL_REGISTER"))

else if (modeValue.equals("PrchangePassword")){
if(agentRegisterHandler.validateAgentPass()){
if(request.getParameter("old_password") != null){
oldPassword = request.getParameter("old_password").trim();
EncryptionUtil ob = new EncryptionUtil();
oldPassword = ob.encrypt(oldPassword);
}
if(request.getParameter("new_password1") != null){
newPassword1 = request.getParameter("new_password1").trim();
EncryptionUtil ob = new EncryptionUtil();
newPassword1 = ob.encrypt(newPassword1);
}
if(request.getParameter("new_password2") != null){
newPassword2 = request.getParameter("new_password2").trim();

}

userID = (String) HSS.getAttribute("usr_email");

try{
professionalRegistration rg2 = new professionalRegistration();
error = rg2.validateUser(userID,oldPassword,"Real_State");
if(error){
error = rg2.updateUserPassword(userID,newPassword1,"Real_State");
if(error){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passwordchangesuccess"));
}else{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passworderror"));
}
}else{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.invalidpassword"));
}
}catch(Exception ex){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.passworderror"));
}
} %>
<jsp:forward page="<%=bundle.getKeyValue(\"professional.changepassword\")%>"/><% }
//update professional bio info
if(modeValue.equals("UPDATE_PRO_BIOINFO"))
{
try
{
if(MultipartFormDataRequest.isMultipartFormData(request)){

firstName = mrequest.getParameter("fname");
lastName = mrequest.getParameter("lname");
password1 = mrequest.getParameter("p_password");
office = mrequest.getParameter("office");
address = mrequest.getParameter("p_address");
state = mrequest.getParameter("state");
zipcode = mrequest.getParameter("p_zip");
city = mrequest.getParameter("p_city");
HSS.setAttribute("mode","processreg1");
attr = new HashMap();
attr.put("an_status", "A");
if(!mrequest.getParameter("p_email").equals(HSS.getAttribute("usr_email"))) {
rg1 = new agentRegistration();

if(rg1.checkAgentOccurance(mrequest.getParameter("p_email"), "Real_State")) {
HSS.setAttribute("errorMessage","This email id is already present. Please select another Id");
%>
<jsp:forward page="<%=bundle.getKeyValue(\"professional.updateinfo\")%>"/><%
} else {
//attr.put("an_status", "I");
status = true;
}
}

EncryptionUtil ob = new EncryptionUtil();
password1 = ob.encrypt(password1);
attr.put("p_fname",firstName);
attr.put("p_lname",lastName);
attr.put("p_password",password1);
attr.put("p_phone",office);
attr.put("p_address",address);
attr.put("p_city",city);
attr.put("p_state",state);
attr.put("p_zip",zipcode);
attr.put("p_email",mrequest.getParameter("p_email"));
attr.put("email", (String)HSS.getAttribute("usr_email"));

professionalRegistration rg2 = new professionalRegistration();
error = rg2.updateProBioInfo(attr,"Real_State");
out.print(error);

if(!error)
{

HSS = request.getSession();
HSS.removeAttribute("errorMessage");
HSS.setAttribute("usr_email",mrequest.getParameter("p_email"));
HSS.setAttribute("usr_name",mrequest.getParameter("fname") + mrequest.getParameter("lname"));
HSS.setAttribute("usr","professional");



if(!status) {
response.sendRedirect(bundle.getKeyValue("professional.login.success"));
} else {
HSS.invalidate();
HSS = null;
HSS = request.getSession();
HSS.setAttribute("email",mrequest.getParameter("p_email"));
HSS.setAttribute("fname", mrequest.getParameter("fname"));
%>
<jsp:forward page="<%=bundle.getKeyValue(\"updation.success\")%>"/>
<%
}

}
else
{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("admin.error"));
%>
<jsp:forward page="joinNetwork.jsp"/><%
}
} // end if(MultipartFormDataRequest.isMultipartFormData(request)){
}//end try
catch(Exception e) {
HSS.setAttribute("errorMessage",errBundle.getKeyValue("admin.error"));
%>
<jsp:forward page="<%=bundle.getKeyValue(\"professional.profile\")%>"/><%
}//end catch
}//end if

//professional intro and images
if(modeValue.equals("EDITPROPROFILE"))
{
try
{
if(MultipartFormDataRequest.isMultipartFormData(request)){

description = mrequest.getParameter("p_description");
fileName = mrequest.getParameter("filename");
fileName1 = mrequest.getParameter("filename1");
if(mrequest.getParameter("noimage")!=null)
{
noimage = mrequest.getParameter("noimage");
}
else
noimage ="Y";
if(mrequest.getParameter("noLogo")!=null)
{
noLogo = mrequest.getParameter("noLogo");
}
else
noLogo ="Y";

Hashtable files = mrequest.getFiles();
if ( (files != null) || (!files.isEmpty())){
UploadFile file = (UploadFile) files.get("uploadfile");
upBean.store(mrequest, "uploadfile");
UploadFile file1 = (UploadFile) files.get("uploadfile1");
upBean.store(mrequest, "uploadfile1");
System.out.println("<li>uploaded files");
}else{
System.out.println("<li>No uploaded files");
}

attr = new HashMap();
EncryptionUtil ob = new EncryptionUtil();
password1 = ob.encrypt(password1);
attr.put("p_noImage",noimage);
attr.put("p_noLogo",noLogo);
attr.put("p_description",description);
attr.put("p_email",mrequest.getParameter("p_email"));
attr.put("p_imageName",fileName);
attr.put("p_logoName",fileName1);
attr.put("p_title",mrequest.getParameter("p_header"));

professionalRegistration rg2 = new professionalRegistration();
error = rg2.updateProProfile(attr,"Real_State");
System.out.print(error);

if(!error)
{

HSS = request.getSession();
HSS.removeAttribute("errorMessage");
HSS.setAttribute("usr_email",mrequest.getParameter("p_email"));
HSS.setAttribute("usr_name",mrequest.getParameter("fname") + mrequest.getParameter("lname"));
HSS.setAttribute("usr","professional");
response.sendRedirect(bundle.getKeyValue("professional.login.success"));

}
else
{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("admin.error"));
%>
<jsp:forward page="<%=bundle.getKeyValue(\"professional.profile\")%>"/><%
}
} // end if(MultipartFormDataRequest.isMultipartFormData(request)){
}//end try
catch(Exception e)
{
String ex = ""+e;
if(ex.indexOf("Upload file size limit reached ")!=-1)
{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("upload.limit"));
}
else
{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("admin.error"));
}
%>
<jsp:forward page="<%=bundle.getKeyValue(\"professional.profile\")%>"/><%


}//end catch
}//end if(modeValue.equals("PROFESSIONAL_REGISTER"))
//***************************************END PROFESSIONAL***********************************************************************//
else if(modeValue.equals("updateAgentEducation"))
{
if(request.getParameter("education")!=null)
education = request.getParameter("education");
if(request.getParameter("ag_university")!=null)
university = request.getParameter("ag_university");
if(request.getParameterValues("ag_certificate")!= null) {
arrCertificate = request.getParameterValues("ag_certificate");
for (int i=0;i<arrCertificate.length;i++){
if (certificate.equals("")){
certificate = arrCertificate[i];
}else{
certificate = certificate + "|" + arrCertificate[i];
}
}
}

attr = new HashMap();
attr.put("ag_education",education);
attr.put("ag_university",university);
attr.put("ag_certificate",certificate);

attr.put("email",HSS.getAttribute("usr_email"));
rg1 = new agentRegistration();
try {
error = rg1.updateAgentEducation(attr,"Real_State");
if(error){
%>
<jsp:forward page="error.htm"/><%}
else {
%>
<jsp:forward page="<%=bundle.getKeyValue(\"agent.updateinfo.success\")%>"/><%}
}
catch(Exception ex){
System.out.print("Exception => "+ex);
}
}//end else if(modeValue.equals("updateAgentEducation"))
else if(modeValue.equals("ADDLISTING"))
{
try {
if(mrequest.getParameter("listingId")!=null)
listingId = mrequest.getParameter("listingId");
if(mrequest.getParameter("agentId")!=null)
li_ag_id = mrequest.getParameter("agentId");
if(mrequest.getParameter("listPrice")!=null)
li_listPrice = mrequest.getParameter("listPrice");
if(mrequest.getParameter("bedroom")!=null)
li_bedrooms = mrequest.getParameter("bedroom");
if(mrequest.getParameter("baths")!=null)
li_baths = mrequest.getParameter("baths");
if(mrequest.getParameter("sqft")!=null)
li_sqFt = mrequest.getParameter("sqft");
if(mrequest.getParameter("city")!=null)
li_city = mrequest.getParameter("city");
if(mrequest.getParameter("desc")!=null)
li_desc = mrequest.getParameter("desc");
if(mrequest.getParameter("filename")!=null){
li_fileName = mrequest.getParameter("filename");
System.out.print("++++++++++++++++++++++++++++++++++++++++++++++++++++++++="+li_fileName);
}

Hashtable files = mrequest.getFiles();
if ( (files != null) || (!files.isEmpty())){
UploadFile file = (UploadFile) files.get("uploadfile");
upBean.store(mrequest, "uploadfile");
System.out.println("<li>uploaded files");
}
else {
System.out.println("<li>No uploaded files");
}

attr = new HashMap();
attr.put("li_ag_id",li_ag_id);
attr.put("li_listPrice",li_listPrice);
attr.put("li_bedrooms",li_bedrooms);
attr.put("li_baths",li_baths);
attr.put("li_sqFt",li_sqFt);
attr.put("li_city",li_city);
attr.put("li_desc",li_desc);
attr.put("li_fileName",li_fileName);
attr.put("li_id",listingId);

if(listingId.equals("")) {
error = agentListing.addListing(attr,"Real_State");
}
else {
error = agentListing.updateListing(attr,"Real_State");
}
if(error){
%>
<jsp:forward page="error.htm"/><%
}
else {
HSS = request.getSession();
HSS.removeAttribute("errorMessage");
%>
<jsp:forward page="agentListing.jsp"/><%
}
}
catch(Exception ex){
System.out.print(ex);
String e = ""+ex;
if(e.indexOf("Upload file size limit reached ")!=-1)
{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("upload.limit"));
}
else
{
HSS.setAttribute("errorMessage",errBundle.getKeyValue("admin.error"));
}
%>
<jsp:forward page="agentListing.jsp"/>
<%
}
}//end else if(modeValue.equals("updateAgentEducation"))

if(modeValue.equals("SELECTAGENT")){
String agentType = "";
String userEmail = "";
String agentId = "";
if (HSS.getAttribute("usr_email")==null){
response.sendRedirect("userLogin.jsp");
}else {
userEmail = (String) HSS.getAttribute("usr_email");
}
if(request.getParameter("AGENTID") != null){
agentId = request.getParameter("AGENTID").trim();
}
if(agentId.equals("")){
response.sendRedirect("userViewAgents.jsp");
}
if(request.getParameter("agentType") != null){
agentType = request.getParameter("agentType").trim();
}
try {
SelectAgent ob = new SelectAgent();
String message = ob.selectedAgent(agentId,userEmail,agentType);
response.sendRedirect("Thanks.jsp?message="+message);
}catch(Exception e){
System.out.println("Error ==>" + e.getMessage());
response.sendRedirect("SelectAgent.jsp");
}
}
//chalk board simple registration
if (modeValue.equals("chalkBoardRegister")){
attr = new HashMap();
if (request.getParameter("sex")!=null){
sex = request.getParameter("sex");
}

if (request.getParameter("userMode1")!=null){
userMode1 = request.getParameter("userMode1");
}

if (request.getParameter("city")!=null){
city = request.getParameter("city");
}

if(request.getParameter("experience")!=null){
experience = request.getParameter("experience");
}
if(request.getParameterValues("commission")!= null) {
commission = request.getParameter("commission");

}
if(request.getParameterValues("industry")!= null) {
arrIndustry = request.getParameterValues("industry");
for (int i=0;i<arrIndustry.length;i++){
if (industry.equals("")){
industry = arrIndustry[i];
}else{
industry = industry + "|" + arrIndustry[i];
}
}
}
if(request.getParameterValues("education")!= null) {
education = request.getParameter("education");

}
if(request.getParameterValues("specialize")!= null) {
arrSpecialize = request.getParameterValues("specialize");
for (int i=0;i<arrSpecialize.length;i++){
if (specialize.equals("")){
specialize = arrSpecialize[i];
}else{
specialize = specialize + "|" + arrSpecialize[i];
}
}
}
if(request.getParameter("languages")!=null){
languages = request.getParameter("languages");
}
if(request.getParameter("email_receipt")!=null){
email_receipt = request.getParameter("email_receipt");
}
String errString = "";
HSS.removeAttribute("mode");
HSS.setAttribute("mode","processreg1");
HSS.setAttribute("first_name",userRegisterHandler.getFirstname());
HSS.setAttribute("last_name",userRegisterHandler.getLastname());
HSS.setAttribute("email",userRegisterHandler.getEmail());
HSS.setAttribute("password1",userRegisterHandler.getPassword1());
HSS.setAttribute("password2",userRegisterHandler.getPassword2());
HSS.setAttribute("sel_zip",userRegisterHandler.getTxtsel_zip());
HSS.setAttribute("city",city);



attr.put("sex",sex);
attr.put("experience",experience);
attr.put("commission",commission);
attr.put("industry",industry);
attr.put("education",education);
attr.put("specialize",specialize);
attr.put("languages",languages);
attr.put("email_receipt",email_receipt);
attr.put("userMode",userMode1);
attr.put("city",city);

if(HSS.getAttribute("first_name")!= null){
firstName = (String)HSS.getAttribute("first_name");
}
if(HSS.getAttribute("last_name")!= null){
lastName = (String)HSS.getAttribute("last_name");
}
if(HSS.getAttribute("email")!= null){
email = (String)HSS.getAttribute("email");
}
if(HSS.getAttribute("password1")!= null){
password1 = (String)HSS.getAttribute("password1");
}
if(HSS.getAttribute("sel_zip")!= null){
selZip = (String)HSS.getAttribute("sel_zip");
}
if(HSS.getAttribute("traits")!= null){
myself = (String)HSS.getAttribute("traits");
}

if(userMode1.equals("buying"))
selZip = "00000";
attr.put("first_name",firstName);
attr.put("last_name",lastName);
attr.put("email",email);
EncryptionUtil ob = new EncryptionUtil();
password1 = ob.encrypt(password1);
attr.put("password1",password1);
attr.put("sel_zip",selZip);
// resister3 variable
attr.put("traits",myself);


if(userRegisterHandler.validateUserRegister1()){
HSS.setAttribute("mode","processreg1");
try{
rg = new registration();
error = rg.checkUserOccurance(userRegisterHandler.getEmail(),"Real_State");
if(!error)
error1 = rg.registerUser(attr,"Real_State");
}catch(Exception ex){

error = true;
}
finally{
attr = null;
rg = null;
}
if(error){
HSS.setAttribute("errorMessage",errBundle.getKeyValue("register.duplicat_emailid")); %>
<jsp:forward page="<%=bundle.getKeyValue(\"process.resister2\")%>"/><% }else if(error1){%>
<jsp:forward page="error.htm"/><%}else{
HSS.removeAttribute("mode");
// In phase 4 it is redirected to userRegisterTwo.jsp ie., process.resister2
HSS.invalidate();
HSS = null;
HSS = request.getSession();
HSS.setAttribute("email",email);
HSS.setAttribute("fname",userRegisterHandler.getFirstname());
%>
<jsp:forward page="<%=bundle.getKeyValue(\"registeration.success\")%>"/><% }
}else{ %>
<jsp:forward page="<%=bundle.getKeyValue(\"process.resister2\")%>"/><% }
// This Block is not necessary It is unreachable block
}
%>


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

"Jsp Tom", please check your private messages for an important administrative matter.

Also, please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

Moved to the Weblogic forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Works with Tomcat but not weblogic
 
Similar Threads
Urrgent Pls Advice as soon as possible
JSP makes me headache
package visibility problem
Enumeration or a better way
login