/ Forside / Teknologi / Udvikling / Java / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Java
#NavnPoint
molokyle 3688
Klaudi 855
strarup 740
Forvirret 660
gøgeungen 500
Teil 373
Stouenberg 360
vnc 360
pmbruun 341
10  mccracken 320
JPS setProperty " * " + JavaBean virker IK~
Fra : Alex B. P.


Dato : 17-10-01 15:20

Hvorfor virker dette IKKE ????

JPS-siden henter fint alle data op fra databasen, MEN ved at klikke på
submit knappen, OG lade JSP-siden kalde sig selv, for at hælde værdier i
Bean'en set'er-metoder, giver næste side kun tomme felter i browseren.

Hvad er fejlen !!! ???

<html>
<head>
<%@ page language="java" import="webconfig.UserBean" %>
<jsp:useBean id="UserBeanID" scope="page" class="webconfig.UserBean" />
<jsp:setProperty name="UserBeanID" property="*" />
<% String reqUserName = request.getParameter("QUserName"); %>
<% if (request.getParameter("JspCommand") != null)
{
if (request.getParameter("JspCommand").equals("show"))
{
UserBeanID.findUser(reqUserName);
}
else if (request.getParameter("JspCommand").equals("save"))
{
UserBeanID.updateUser(reqUserName);
}
} // end if .... JspCommand !=null ..
%>
<%! String convertTrueToSelected (String inStr)
{
// Java-metode - Konverterer TRUE -> ON og FALSE -> OFF

String outStr = "";
// Lav kun ændring, hvis input ikke er NULL
if (inStr != null)
{
if (inStr.equals("TRUE") )
{
outStr = "checked";
}

else if (inStr.equals("FALSE") )
{
outStr = "";
}
else


outStr = ""; //
}
}
return outStr;
} %>

<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link REL="STYLESHEET" HREF="css/style01.css" TYPE="text/css">
<title>User - Config</title>
<base target="_self">
</head>

<body topmargin="5" leftmargin="10">

<table border="0" cellpadding="2" cellspacing="1" width="600" height="241">
<tr>
<td width="602" height="26" align="center">
</td>
</tr>
<tr>
<td width="586" height="26" align="center" bgcolor="#008080">
<p align="center"><b><u><font face="Verdana" color="#FFFFFF"
size="4">Bruger - (Vis / Rediger)</font></u></b>
</p>
</td>
</tr>
<tr>
<td width="602" height="1" align="center">
</td>
</tr>
<tr>
<td width="559" height="116" align="center"><form method="POST"
onSubmit="" action="User_ShowEdit?QUserName="+reqUserName>
<table border="0" width="112%" cellpadding="2" height="357">
<tr>
<td width="33%" height="25" bgcolor="#CCCCCC">
<p align="left"><b><font face="Verdana" color="#000000"
size="2">Bruger navn:</font></b></p>
</td>
<td width="75%" height="25"><font face="Verdana" size="1"><b><input
readonly type="text" name="UserName" size="50" value="<%=
UserBeanID.getuserName() %>" valuetabindex="1" style="font-family: Verdana;
font-size: 8pt"></b></font></td>
</tr>
<tr>
<td width="100%" colspan="2" height="21">
<hr>
</td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="25" align="right">
<p align="left"><b><font face="Verdana" size="2">Altid
øverst:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="25"><font size="1"><input
type="checkbox" name="AlwaysOnTop" value="<%= UserBeanID.getAlwaysOnTop()
%>" <%= convertTrueToSelected( UserBeanID.getAlwaysOnTop() ) %>></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="25" align="right">
<p align="left"><b><font face="Verdana" size="2">Start
minimeret:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="25"><font size="1"><input
type="checkbox" name="StartMinimized" value="<%=
UserBeanID.getStartMinimized() %>" <%=
onvertTrueToSelected( UserBeanID.getStartMinimized() ) %>></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="26" align="right">
<p align="left"><b><font face="Verdana" size="2">Blink ved indkommende
opkald:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="26"><font size="1"><input
type="checkbox" name="FlashWhenArrivingCall" value="<%=
UserBeanID.getFlashWhenArrivingCall() %>" <%=
onvertTrueToSelected( UserBeanID.getFlashWhenArrivingCall() )
%>></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font face="Verdana" size="2">Vis
Quit-Dialog:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><font size="1"><input
type="checkbox" name="ShowQuitDialog" value="<%=
UserBeanID.getShowQuitDialog() %>" <%=
onvertTrueToSelected( UserBeanID.getShowQuitDialog() ) %>></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">Agent
Login-ID:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><font size="1"><input
type="text" name="AgentLoginId" size="50" value="<%=
UserBeanID.getAgentLoginId() %>" style="font-family: Verdana; font-size:
8pt"></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">Udskyd call-back i
antal minutter:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><font size="1"><input
type="text" name="RejectCallBackTime" size="50" value="<%=
UserBeanID.getRejectCallBackTime() %>" style="font-family: Verdana;
font-size: 8pt"></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">Automatisk&nbsp;<br>
besvar kald:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><input type="checkbox"
name="AutomaticAnswer" value="<%= UserBeanID.getAutomaticAnswer() %>" <%=
convertTrueToSelected( UserBeanID.getAutomaticAnswer() )%>></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">Automatisk&nbsp;<br>
klar ved indmeld:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><input type="checkbox"
name="AutomaticReady" value="<%=UserBeanID.getAutomaticReady() %>" <%=
convertTrueToSelected( UserBeanID.getAutomaticReady() )%>></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">ACD-Script udføres
som default ved kald:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><input type="checkbox"
name="ACDScriptDefault" value="<%= UserBeanID.getACDScriptDefault() %>" <%=
convertTrueToSelected( UserBeanID.getACDScriptDefault() )%>></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font face="Verdana"
size="2">Bemærkninger:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><textarea rows="2"
name="remark" cols="48"><%= UserBeanID.getremark() %></textarea></td>
</tr>
<tr>
<td width="100%" colspan="2" height="21">
<hr>
</td>
</tr>
<tr>
<td width="102%" colspan="2" align="center" height="27"><font
face="Verdana" size="2"><input type="submit" value="GEM ændringer"
name="B1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Nulstil" name="B2"></font></td>
</tr>
<tr>
<td width="102%" colspan="2" align="center" height="21">&nbsp;</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td width="602" height="26"><hr width="530">
</td>
</tr>
<tr>
<td width="456" height="22" align="center">
<p align="center">
</td>
</tr>
<tr>
<td width="568" valign="middle" align="center" height="53">
<font size="1" face="Verdana"><i>
©&nbsp; Copyright&nbsp; 2001 by TDC - Tele Danmark&nbsp; -&nbsp; All
rights reserved.</i></font></td>
</tr>
</table>

</body>

</html>

//////////////////////////////////////////////////////

package webconfig;

/**
* Title: webconfig
* Description:
* Copyright: Copyright (c) 2001
* Company:
* @author ABP
* @version 1.0
*/

import java.sql.*;
import java.util.*;
import java.util.Arrays;

public class UserBean extends SQLResult {

// public static webconfig.User user = new webconfig.User();

// Instans variabler
private static String ID = "0"; // Nøgle genereres udfra databaseopkald
til tabel ???? samt en beregn af næste nr.
private static String User = "";
private static String userName = "";
private static String Password = "";
private static String RegistryPath;
private static String AlwaysOnTop;
private static String StartMinimized;
private static String FlashWhenArrivingCall;
private static String OkColor;
private static String InfoColor;
private static String ErrorColor;
private static String ShowQuitDialog;
private static String QuitColor;
private static String ButtonUpColor;
private static String ButtonInterColor;
private static String ButtonDownColor;
private static String INFOWINBKCOLOR;
private static String INFOWINFONTCOLOR;
private static String AgentLoginId;
private static String RejectCallBackTime;
private static String AutomaticAnswer;
private static String AutomaticReady;
private static String ACDScriptDefault;
private static String Pos_MSPDNForm_TopLeft;
private static String Pos_MSPDNForm_BottomRight;
private static String Pos_GUIForm_TopLeft;
private static String Pos_GUIForm_BottomRight;
private static String Pos_InfoDialog_TopLeft;
private static String Pos_InfoDialog_BottomRight;
private static String Pos_LogForm_TopLeft;
private static String Pos_LogForm_BottomRight;
private static String Pos_MSPForm_TopLeft;
private static String Pos_MSPForm_BottomRight;
private static String Pos_MSPACDForm_TopLeft;
private static String Pos_MSPACDForm_BottomRight;
private static String Pos_ScripterForm_TopLeft;
private static String Pos_ScripterForm_BottomRight;
private static String Pos_ScriptInfo_TopLeft;
private static String Pos_ScriptInfo_BottomRight;
private static String DisplayColor;
private static String DnisDisplayColor;
private static String CallbackDisplayColor;
private static String Pos_CRCallbackDlg_TopLeft;
private static String Pos_CRCallbackDlg_BottomRight;
private static String INFOWINSTYLE;
private static String Pos_Callback_TopLeft;
private static String Pos_Callback_BottomRight;
private static String Pos_WEB_TopLeft;
private static String Pos_WEB_BottomRight;
private static String remark = "";


//**************************************************************************
***********
// Constructors
public UserBean() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}

//UserBean userBean = new UserBean();


//--END
CONSTRUCTORS----------------------------------------------------------------
---------//

// Set metoder

public void setID(String ID){
this.ID = ID;
}

public void setUser(String User){
this.User = User;
}
public void setuserName(String userName){
this.userName = userName;
}
public void setPassword(String Password){
this.Password = Password;
}
public void setRegistryPath(String RegistryPath){
this.RegistryPath = RegistryPath;
}

// --- ... tilføj alle de andre, .. engang ....->>>

public void setAlwaysOnTop(String AlwaysOnTop) {
this.AlwaysOnTop = AlwaysOnTop;
}

public void setStartMinimized(String StartMinimized) {
this.StartMinimized = StartMinimized;
}
public void setFlashWhenArrivingCall(String FlashWhenArrivingCall) {
this.FlashWhenArrivingCall = FlashWhenArrivingCall;
}


public void setShowQuitDialog(String ShowQuitDialog) {
this.ShowQuitDialog = ShowQuitDialog;
}

public void setAgentLoginId(String AgentLoginId)

this.AgentLoginId = AgentLoginId;
}
public void setRejectCallBackTime(String RejectCallBackTime)

this.RejectCallBackTime = RejectCallBackTime;
}
public void setAutomaticAnswer(String AutomaticAnswer)

this.AutomaticAnswer = AutomaticAnswer;
}
public void setAutomaticReady(String AutomaticReady)

this.AutomaticReady = AutomaticReady;
}
public void setACDScriptDefault(String ACDScriptDefault)

this.ACDScriptDefault = ACDScriptDefault;
}



// --- ... tilføj alle de andre, .. engang ....->>>



public void setremark(String remark){
this.remark = remark;
}
// end set metoder
//--------------------------------------------------------------------------
------------//

//Get metoder

public String getID(){
return ID;
}

public String getUser(){
return User;
}
public String getuserName(){
return userName;
}
public String getPassword(){
return Password;
}
public String getRegistryPath(){
return RegistryPath;
}


// --- ... tilføj alle de andre, .. engang ....->>>


public String getAlwaysOnTop(){
return AlwaysOnTop;
}

public String getStartMinimized(){
return StartMinimized;
}
public String getFlashWhenArrivingCall(){
return FlashWhenArrivingCall;
}
public String getShowQuitDialog(){
return ShowQuitDialog;
}
public String getAgentLoginId(){
return AgentLoginId;
}
public String getRejectCallBackTime(){
return RejectCallBackTime;
}
public String getAutomaticAnswer(){
return AutomaticAnswer;
}
public String getAutomaticReady(){
return AutomaticReady;
}
public String getACDScriptDefault(){
return ACDScriptDefault;
}


public String getremark(){
return remark;
}

//--------------------------------------------------------------------------
-<


public ResultSet getRsAllUsers() {
ResultSet allUsersRs = null;
//SQLResult sqlrs = new SQLResult();
rs = queryDB("Select * From User");
allUsersRs = rs;
return allUsersRs;
}

public ResultSet getRsUsers(String QueryUserName) {
ResultSet userNames = null;
rs = queryDB("Select * From User Where UserName = '" + QueryUserName +
"'");
userNames = rs;
return userNames;
}

public void findUser(String QueryUserName) {
//ResultSet userRs = null;
ResultSet userRs;
// userRs = queryDB("Select
UserName,Password,AlwaysOnTop,StartMinimized,ShowQuitDialog,AgentLoginId,Rej
ectCallBackTime,AutomaticAnswer,AutomaticReady,ACDScriptDefault,Remark " +
// "From User Where UserName = '" + QueryUserName +
"'");

userRs = queryDB("Select
User,UserName,Password,AlwaysOnTop,StartMinimized,FlashWhenArrivingCall,Show
QuitDialog,AgentLoginId,RejectCallBackTime,AutomaticAnswer,AutomaticReady,AC
DScriptDefault,Remark From User Where UserName = '" + QueryUserName + "'");
// userRs = queryDB("SELECT * FROM User");
clearUserContent(); // Rens object for tidligere data FØR næste
SQL-query
try {
while (userRs.next()) {
//user.setID(( userRs.getInt("ID") );
setUser(userRs.getString("User") );
//System.out.println("Hallo - nu r vi ved SetUserName");
setuserName(userRs.getString("UserName") );
setPassword(userRs.getString("Password") );
setAlwaysOnTop(userRs.getString("AlwaysOnTop") );
setStartMinimized(userRs.getString("StartMinimized") );

setFlashWhenArrivingCall(userRs.getString("FlashWhenArrivingCall") );
setShowQuitDialog( userRs.getString("ShowQuitDialog") );
setAgentLoginId(userRs.getString("AgentLoginId") );
setRejectCallBackTime(userRs.getString("RejectCallBackTime") );
setAutomaticAnswer( userRs.getString("AutomaticAnswer") );
setAutomaticReady( userRs.getString("AutomaticReady") );
setACDScriptDefault( userRs.getString("ACDScriptDefault") );
setremark(userRs.getString("Remark") );
} // while-løkke

// userRs.close(); // Lukker result-sæt
// SQLResult.con.close(); // Lukker database-forbindelse

System.out.println("Database kald ...");
}
catch (Exception e)
{
System.out.println("Exception catch ....");
System.out.println(e);
// return "Fejl";
}
} // end void findUser(String userName) {


public void updateUser(String QUserName)
{
System.out.println("updateUser metoden i JavaBean'en er her kaldt
"+QUserName);
}


public void clearUserContent() {

// user.setID(initValNr);
setID("0");
setUser("");
setuserName("");
setPassword("");
setRegistryPath("");
setAlwaysOnTop("");
setStartMinimized("");
setFlashWhenArrivingCall("");
setShowQuitDialog("");
setAgentLoginId("");
setRejectCallBackTime("");
setAutomaticAnswer("");
setAutomaticReady("");
setACDScriptDefault("");

setremark("");


} // end public void clearObjectContent() {

// -------------------------------------------------------------------------
-->


// Konverteringsmetoder -------------------------------->
public int StrToInt(String string) {
int tal = Integer.parseInt(string);
return tal;
}

public String IntToStr( int tal) {
String string = "";
string += tal;
return string;
}


// Konverteringsmetoder --------------------------------<

private void jbInit() throws Exception {
} // End

} // end public class UserBean extends SQLResult


Mvh

Alex B. P.
TDC A/S




 
 
Jakob Møllerhøj (17-10-2001)
Kommentar
Fra : Jakob Møllerhøj


Dato : 17-10-01 17:13


"Alex B. P." <alexbp@post.tele.dk> wrote in message
news:3bcd930b$0$42008$edfadb0f@dspool01.news.tele.dk...
> Hvorfor virker dette IKKE ????
>
> JPS-siden henter fint alle data op fra databasen, MEN ved at klikke på
> submit knappen, OG lade JSP-siden kalde sig selv, for at hælde værdier i
> Bean'en set'er-metoder, giver næste side kun tomme felter i browseren.
>
> Hvad er fejlen !!! ???
>
> Mvh
>
> Alex B. P.
> TDC A/S
>

De steder, du ønsker at hive variabel-værdier ud af bønnen skulle du tage at
bruge:
<jsp:getProperty> taggen, som er til for det samme. Så de steder hvor du vil
indsætte bønne-variabler kan du eksempelvist gøre følgende:

<TR><TH>Navn:</TH><TD> <jsp:getProperty name="dit_bean_alias"
property="navn" /></TD></TR>

mvh.
Jakob



Alex B. P. (18-10-2001)
Kommentar
Fra : Alex B. P.


Dato : 18-10-01 09:31

Ja, jeg er med på at man kan bruge getProperty ....
og at den så henter de respektive getXxxxxxxx metoder i Bean'en ..

Nu har jeg valgt at skrive f.eks.

' UserBeanId.getUserName() '

hvilket jo er det samme som :

<jsp:getProperty name="UserBeanID"> property="UserName" />

Jeg syntes bare mit er mere logisk, m.h.t. reuseable code


"Jakob Møllerhøj" <jackd@vip.cybercity.dk> wrote in message
news:9qkako$22dt$1@news.cybercity.dk...
>
> "Alex B. P." <alexbp@post.tele.dk> wrote in message
> news:3bcd930b$0$42008$edfadb0f@dspool01.news.tele.dk...
> > Hvorfor virker dette IKKE ????
> >
> > JPS-siden henter fint alle data op fra databasen, MEN ved at klikke på
> > submit knappen, OG lade JSP-siden kalde sig selv, for at hælde værdier i
> > Bean'en set'er-metoder, giver næste side kun tomme felter i browseren.
> >
> > Hvad er fejlen !!! ???
> >
> > Mvh
> >
> > Alex B. P.
> > TDC A/S
> >
>
> De steder, du ønsker at hive variabel-værdier ud af bønnen skulle du tage
at
> bruge:
> <jsp:getProperty> taggen, som er til for det samme. Så de steder hvor du
vil
> indsætte bønne-variabler kan du eksempelvist gøre følgende:
>
> <TR><TH>Navn:</TH><TD> <jsp:getProperty name="dit_bean_alias"
> property="navn" /></TD></TR>
>
> mvh.
> Jakob
>
>



Jakob Møllerhøj (17-10-2001)
Kommentar
Fra : Jakob Møllerhøj


Dato : 17-10-01 17:18


----- Original Message -----
From: "Alex B. P." <alexbp@post.tele.dk>
Newsgroups: dk.edb.programmering.java
Sent: Wednesday, October 17, 2001 4:19 PM
Subject: JPS setProperty " * " + JavaBean virker IKKE ???


> Hvorfor virker dette IKKE ????
>
> JPS-siden henter fint alle data op fra databasen, MEN ved at klikke på
> submit knappen, OG lade JSP-siden kalde sig selv, for at hælde værdier i
> Bean'en set'er-metoder, giver næste side kun tomme felter i browseren.
>
> Hvad er fejlen !!! ???
>

> // Instans variabler
> private static String ID = "0"; // Nøgle genereres udfra databaseopkald
> til tabel ???? samt en beregn af næste nr.
> private static String User = "";
> private static String userName = "";
> private static String Password = "";
> private static String RegistryPath;
> private static String AlwaysOnTop;
> private static String StartMinimized;
> private static String FlashWhenArrivingCall;
> private static String OkColor;
> private static String InfoColor;
> private static String ErrorColor;
> private static String ShowQuitDialog;
> private static String QuitColor;
> private static String ButtonUpColor;
> private static String ButtonInterColor;
> private static String ButtonDownColor;
> private static String INFOWINBKCOLOR;
> private static String INFOWINFONTCOLOR;
> private static String AgentLoginId;
> private static String RejectCallBackTime;
> private static String AutomaticAnswer;
> private static String AutomaticReady;
> private static String ACDScriptDefault;
> private static String Pos_MSPDNForm_TopLeft;
> private static String Pos_MSPDNForm_BottomRight;
> private static String Pos_GUIForm_TopLeft;
> private static String Pos_GUIForm_BottomRight;
> private static String Pos_InfoDialog_TopLeft;
> private static String Pos_InfoDialog_BottomRight;
> private static String Pos_LogForm_TopLeft;
> private static String Pos_LogForm_BottomRight;
> private static String Pos_MSPForm_TopLeft;
> private static String Pos_MSPForm_BottomRight;
> private static String Pos_MSPACDForm_TopLeft;
> private static String Pos_MSPACDForm_BottomRight;
> private static String Pos_ScripterForm_TopLeft;
> private static String Pos_ScripterForm_BottomRight;
> private static String Pos_ScriptInfo_TopLeft;
> private static String Pos_ScriptInfo_BottomRight;
> private static String DisplayColor;
> private static String DnisDisplayColor;
> private static String CallbackDisplayColor;
> private static String Pos_CRCallbackDlg_TopLeft;
> private static String Pos_CRCallbackDlg_BottomRight;
> private static String INFOWINSTYLE;
> private static String Pos_Callback_TopLeft;
> private static String Pos_Callback_BottomRight;
> private static String Pos_WEB_TopLeft;
> private static String Pos_WEB_BottomRight;
> private static String remark = "";

Hvorfor har du forresten lavet alle dine bønne-variabler statiske?

jakob





Alex B. P. (18-10-2001)
Kommentar
Fra : Alex B. P.


Dato : 18-10-01 08:52

For at sikre "scope" for attributterne gælder i hele Bean'ens område/metoder
.... - Det var i al fald hensigten.

derfor ... private static ....

Mvh

Alex B. P.



"Jakob Møllerhøj" <jackd@vip.cybercity.dk> wrote in message
news:9qkaus$22kh$1@news.cybercity.dk...
>
> ----- Original Message -----
> From: "Alex B. P." <alexbp@post.tele.dk>
> Newsgroups: dk.edb.programmering.java
> Sent: Wednesday, October 17, 2001 4:19 PM
> Subject: JPS setProperty " * " + JavaBean virker IKKE ???
>
>
> > Hvorfor virker dette IKKE ????
> >
> > JPS-siden henter fint alle data op fra databasen, MEN ved at klikke på
> > submit knappen, OG lade JSP-siden kalde sig selv, for at hælde værdier i
> > Bean'en set'er-metoder, giver næste side kun tomme felter i browseren.
> >
> > Hvad er fejlen !!! ???
> >
>
> > // Instans variabler
> > private static String ID = "0"; // Nøgle genereres udfra
databaseopkald
> > til tabel ???? samt en beregn af næste nr.
> > private static String User = "";
> > private static String userName = "";
> > private static String Password = "";
> > private static String RegistryPath;
> > private static String AlwaysOnTop;
> > private static String StartMinimized;
> > private static String FlashWhenArrivingCall;
> > private static String OkColor;
> > private static String InfoColor;
> > private static String ErrorColor;
> > private static String ShowQuitDialog;
> > private static String QuitColor;
> > private static String ButtonUpColor;
> > private static String ButtonInterColor;
> > private static String ButtonDownColor;
> > private static String INFOWINBKCOLOR;
> > private static String INFOWINFONTCOLOR;
> > private static String AgentLoginId;
> > private static String RejectCallBackTime;
> > private static String AutomaticAnswer;
> > private static String AutomaticReady;
> > private static String ACDScriptDefault;
> > private static String Pos_MSPDNForm_TopLeft;
> > private static String Pos_MSPDNForm_BottomRight;
> > private static String Pos_GUIForm_TopLeft;
> > private static String Pos_GUIForm_BottomRight;
> > private static String Pos_InfoDialog_TopLeft;
> > private static String Pos_InfoDialog_BottomRight;
> > private static String Pos_LogForm_TopLeft;
> > private static String Pos_LogForm_BottomRight;
> > private static String Pos_MSPForm_TopLeft;
> > private static String Pos_MSPForm_BottomRight;
> > private static String Pos_MSPACDForm_TopLeft;
> > private static String Pos_MSPACDForm_BottomRight;
> > private static String Pos_ScripterForm_TopLeft;
> > private static String Pos_ScripterForm_BottomRight;
> > private static String Pos_ScriptInfo_TopLeft;
> > private static String Pos_ScriptInfo_BottomRight;
> > private static String DisplayColor;
> > private static String DnisDisplayColor;
> > private static String CallbackDisplayColor;
> > private static String Pos_CRCallbackDlg_TopLeft;
> > private static String Pos_CRCallbackDlg_BottomRight;
> > private static String INFOWINSTYLE;
> > private static String Pos_Callback_TopLeft;
> > private static String Pos_Callback_BottomRight;
> > private static String Pos_WEB_TopLeft;
> > private static String Pos_WEB_BottomRight;
> > private static String remark = "";
>
> Hvorfor har du forresten lavet alle dine bønne-variabler statiske?
>
> jakob
>
>
>
>



Klaus Hebsgaard (18-10-2001)
Kommentar
Fra : Klaus Hebsgaard


Dato : 18-10-01 11:55


"Alex B. P." <alexbp@post.tele.dk> wrote in message
news:3bcd930b$0$42008$edfadb0f@dspool01.news.tele.dk...
> Hvorfor virker dette IKKE ????
>
> JPS-siden henter fint alle data op fra databasen, MEN ved at klikke på
> submit knappen, OG lade JSP-siden kalde sig selv, for at hælde værdier i
> Bean'en set'er-metoder, giver næste side kun tomme felter i browseren.

Felterne skal du da selv fylde ud igen:

-hent data fra requestobjektet:
String complete = request.getParameter("complete");

-indsæt dissse i form'en:
<input type="text" name="complete" value="<%=complete%>">

Er det mig der har misforstået noget? - Sådan gør jeg ihvertfald, når jeg
skal gøre, som du beskriver...

MVH

Klaus Hebsgaard





Alex B. P. (18-10-2001)
Kommentar
Fra : Alex B. P.


Dato : 18-10-01 13:09

Hmmm ...

Har ikke helt forstået dit spørgsmål/kommentar ...

MEN jeg sender lige min Bean nu, DEN VIRKER (tak til 'disky') uden at skulle
kalde alle <:jsp setXxxxx property ...> ved alle attributter indivuduelt,
MEN tager via property="*" ALLE værdier i mine name"xxx" ganske automatisk -
ret smart, og dynamisk ved ænringer i JSP-siden sidenhen
.... lige præcis det jeg gerne ville ...

Så, så'n er det bare .... - fejlen var en helt anden, end man skulle tro.
Af en eller anden besynderlig (læs: "latterlig Java") årsag, skal
att.navne's 1. bogstav være small-case, -> uSERName men set-/get metoder
skal have 1. bogstav med upper-case -> setUsername /getUsername.

... ikke specielt oplagt ...

Mvh

Alex B. P.


////////////////////////////////////////////////////////////////////////////
////////////////////////////

<html>
<head>
<%@ page language="java" import="webconfig.UserBean" %>
<jsp:useBean id="UserBeanID" scope="page" class="webconfig.UserBean" />
<jsp:setProperty name="UserBeanID" property="*" />
<%
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");

if (request.getProtocol().equals("HTTP/1.1"))


response.setHeader("Cache-Control", "no-cache");
}
%>
<% String reqUserName = request.getParameter("QUserName"); %>
<% if (request.getParameter("JspCommand") != null)
{
if (request.getParameter("JspCommand").equals("show"))
{
UserBeanID.findUser(reqUserName);
}
else if (request.getParameter("JspCommand").equals("save"))
{
if (UserBeanID.updateUser(reqUserName) )
%>Database ER OPDATERET !!!<%
else
%>Database IKKE OPDATERET !!!<%
}
} // end if .... JspCommand !=null ..
%>
<%! String convertTrueToSelected (String inStr)
{
// Java-metode - Konverterer TRUE -> ON og FALSE -> OFF

String outStr = "";
// Lav kun ændring, hvis input ikke er NULL
if (inStr != null)
{
if (inStr.equals("TRUE") )
{
outStr = "checked";
}

else if (inStr.equals("FALSE") )
{
outStr = "";
}
else


outStr = ""; //
}
}
return outStr;
} %>

<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link REL="STYLESHEET" HREF="css/style01.css" TYPE="text/css">
<title>User - Config</title>
<base target="_self">
</head>

<body topmargin="5" leftmargin="10">

<table border="0" cellpadding="2" cellspacing="1" width="600" height="241">
<tr>
<td width="602" height="26" align="center">
</td>
</tr>
<tr>
<td width="586" height="26" align="center" bgcolor="#008080">
<p align="center"><b><u><font face="Verdana" color="#FFFFFF"
size="4">Bruger - (Vis / Rediger)</font></u></b>
</p>
</td>
</tr>
<tr>
<td width="602" height="1" align="center">
</td>
</tr>
<tr>
<td width="559" height="116" align="center"><form method="POST"
onSubmit=""
action="User_ShowEdit.jsp?QUserName=<%=reqUserName%>&JspCommand=save">
<table border="0" width="112%" cellpadding="2" height="357">
<tr>
<td width="33%" height="25" bgcolor="#CCCCCC">
<p align="left"><b><font face="Verdana" color="#000000"
size="2">Bruger navn:</font></b></p>
</td>
<td width="75%" height="25"><font face="Verdana" size="1"><b><input
readonly type="text" name="userName" size="50" value="<%=
UserBeanID.getuserName() %>" valuetabindex="1" style="font-family: Verdana;
font-size: 8pt"></b></font></td>
</tr>
<tr>
<td width="100%" colspan="2" height="21">
<hr>
</td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="25" align="right">
<p align="left"><b><font face="Verdana" size="2">Altid
øverst:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="25"><font size="1"><input
type="checkbox" name="alwaysOnTop" value="<%= UserBeanID.getAlwaysOnTop()
%>" <%= convertTrueToSelected( UserBeanID.getAlwaysOnTop() ) %>></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="25" align="right">
<p align="left"><b><font face="Verdana" size="2">Start
minimeret:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="25"><font size="1"><input
type="checkbox" name="startMinimized" value="<%=
UserBeanID.getStartMinimized() %>" <%=
onvertTrueToSelected( UserBeanID.getStartMinimized() ) %>></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="26" align="right">
<p align="left"><b><font face="Verdana" size="2">Blink ved indkommende
opkald:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="26"><font size="1"><input
type="checkbox" name="flashWhenArrivingCall" value="<%=
UserBeanID.getFlashWhenArrivingCall() %>" <%=
onvertTrueToSelected( UserBeanID.getFlashWhenArrivingCall() )
%>></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font face="Verdana" size="2">Vis
Quit-Dialog:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><font size="1"><input
type="checkbox" name="showQuitDialog" value="<%=
UserBeanID.getShowQuitDialog() %>" <%=
onvertTrueToSelected( UserBeanID.getShowQuitDialog() ) %>></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">Agent
Login-ID:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><font size="1"><input
type="text" name="agentLoginId" size="50" value="<%=
UserBeanID.getAgentLoginId() %>" style="font-family: Verdana; font-size:
8pt"></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">Udskyd call-back i
antal minutter:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><font size="1"><input
type="text" name="rejectCallBackTime" size="50" value="<%=
UserBeanID.getRejectCallBackTime() %>" style="font-family: Verdana;
font-size: 8pt"></font></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">Automatisk&nbsp;<br>
besvar kald:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><input type="checkbox"
name="automaticAnswer" value="<%= UserBeanID.getAutomaticAnswer() %>" <%=
convertTrueToSelected( UserBeanID.getAutomaticAnswer() )%>></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">Automatisk&nbsp;<br>
klar ved indmeld:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><input type="checkbox"
name="automaticReady" value="<%=UserBeanID.getAutomaticReady() %>" <%=
convertTrueToSelected( UserBeanID.getAutomaticReady() )%>></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font size="2" face="Verdana">ACD-Script udføres
som default ved kald:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><input type="checkbox"
name="aCDScriptDefault" value="<%= UserBeanID.getACDScriptDefault() %>" <%=
convertTrueToSelected( UserBeanID.getACDScriptDefault() )%>></td>
</tr>
<tr>
<td width="33%" bgcolor="#CCCCCC" height="1" align="right">
<p align="left"><b><font face="Verdana"
size="2">Bemærkninger:</font></b></p>
</td>
<td width="75%" bgcolor="#CCCCCC" height="1"><textarea rows="2"
name="remark" cols="48"><%= UserBeanID.getremark() %></textarea></td>
</tr>
<tr>
<td width="100%" colspan="2" height="21">
<hr>
</td>
</tr>
<tr>
<td width="102%" colspan="2" align="center" height="27"><font
face="Verdana" size="2"><input type="submit" value="GEM ændringer"
name="B1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Nulstil" name="B2"></font></td>
</tr>
<tr>
<td width="102%" colspan="2" align="center" height="21">&nbsp;</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td width="602" height="26"><hr width="530">
</td>
</tr>
<tr>
<td width="456" height="22" align="center">
<p align="center">
</td>
</tr>
<tr>
<td width="568" valign="middle" align="center" height="53">
<font size="1" face="Verdana"><i>
©&nbsp; Copyright&nbsp; 2001 by TDC - Tele Danmark&nbsp; -&nbsp; All
rights reserved.</i></font></td>
</tr>
</table>

</body>

</html>



"Klaus Hebsgaard" <kh@ingenioer.dk> wrote in message
news:3bceb5ba$0$749$edfadb0f@dspool01.news.tele.dk...
>
> "Alex B. P." <alexbp@post.tele.dk> wrote in message
> news:3bcd930b$0$42008$edfadb0f@dspool01.news.tele.dk...
> > Hvorfor virker dette IKKE ????
> >
> > JPS-siden henter fint alle data op fra databasen, MEN ved at klikke på
> > submit knappen, OG lade JSP-siden kalde sig selv, for at hælde værdier i
> > Bean'en set'er-metoder, giver næste side kun tomme felter i browseren.
>
> Felterne skal du da selv fylde ud igen:
>
> -hent data fra requestobjektet:
> String complete = request.getParameter("complete");
>
> -indsæt dissse i form'en:
> <input type="text" name="complete" value="<%=complete%>">
>
> Er det mig der har misforstået noget? - Sådan gør jeg ihvertfald, når jeg
> skal gøre, som du beskriver...
>
> MVH
>
> Klaus Hebsgaard
>
>
>
>



Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408927
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste