Help whit dinamyc jsp events ^^
Hello:
hummmm! need help in create jsp (xml, xsl, xslt or whatever) whit dinamic html components events like checkbox, i.e:
When i click in a checkbox or radio button, the action (event) must make me generate dinamyc html code like show fields or forms (not hide forms or tables, just generate tables or forms whit the checkbox or radio button actions). But i wan�t use javascript just JSP, XML, XSL or whatever.
Please give me help =P plz
You can use AJAX for doing this. Or you can submit the page onchange event of the combo and get the required values from the DB and set the values in the text field.
Please check the onchange attribute of the select tag.
Similar Messages
-
How to call elem. Search help on Button click event in WD appilcation
Hello All,
i have requirement to call elem. search help on button click event in WD application. currently i am calling FM F4IF_START_VALUE_REQUEST but getting the short dump as below,
The following error text was processed in the system X31 : Screen output without connection to user.
The error occurred on the application server saps_X31_31 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
SYSTEM-EXIT of program SAPLSDH4
Function: F4_PRESEL_WITH_TABSTRIP of program SAPLSDH4
Form: F4PROZ_STEP_PRESEL of program SAPLSDSD
Function: DD_SHLP_SINGLE_STEP of program SAPLSDSD
Form: F4PROZ_LOOP of program SAPLSDSD
Form: F4PROZ of program SAPLSDSD
Function: F4IF_START_VALUE_REQUEST of program SAPLSDHI
Method: ONACTIONSEARCH_CUSTOMER of program /1BCWDY/50TU5ZEXF3K0IWCWE153==CP
Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/50TU5ZEXF3K0IWCWE153==CP
Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
is there any way to achieve the required behaviour.
please let me know.
Regards,
ChandraHi Friends,
I have the similar kind of requirement. Upon click on a Button on screen i need to call a search help, and collect one or more selected material numbers.
The search help is working fine and i am getting the entries with the following code.
The problem is i am finding extra popup on screen.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = space
fieldname = space
SEARCHHELP = 'MAT1'
MULTIPLE_CHOICE = 'X'
STEPL = 0
value = 'MATNR'
*dynpprog = progname
*dynpnr = dynnum
*dynprofield = 'CARRIER'
CALLBACK_PROGRAM = 'ZTEST_1_PRA'
CALLBACK_FORM = 'F4CALLBACK'
TABLES
RETURN_TAB = RETURN_TAB
EXCEPTIONS
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5. -
Hi everyone, i need help whit translate the after effect from spanish into english, please help i need to end a work in this week.
There's some Spanish AE tutorials here:
http://aftereffects.260mb.com/
And a purchaseable training course in Spanish:
http://gfxdomain.com/blog/2012/05/video2brain-after-effects-tools-cs6-spanish.html -
Hi, The Airport Express does not work with iOS 7.0.4, I appreciate your help to resolve this event. Thank you,
Please locate the model number of the AirPort Express and post back that information.
The model number is located on the side of the AirPort Express. It begins with an "A" followed by four numbers.
We are not sure what you mean by "does not work". Does this mean that the AirPort Express worked at one time and has just recently stopped working?
Have you installed a newer operating system on your iOS device recently?
Or, is this a new AirPort Express that you are trying to configure for the first time?
If yes, what service will the AirPort Express perform on your network?
Please remember that we cannot see your network, so we only know as much about your problem as you can tell us. -
Help with dispatching JTable event to underlying components in a cell.
Hello..
I have a JTable in which i show a panel with clickable labels.. I found that jTable by default doesnt dispatch or allow mouseevents to be caught by underlying elements..
i need help with dispatching an event from jTable to a label on a panel in a jTable cell.. below is the code i have come up with after finding help with some websites. but i couldnt not get it right.. my dispatched event seems to go back to the jtable itself ..
any help or suggestion is appreciated..
Thanks
'Harish.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.table.*;
* @author harish
public class tableDemo extends javax.swing.JFrame {
JTable jTable1;
testpane dummyPane;
/** Creates new form tableDemo */
public tableDemo() {
initComponents();
//table settings
String[] columnNames = {"Task", "Action"," "};
Object[][] data = { };
DefaultTableModel model = new DefaultTableModel(data, columnNames) {
// This method returns the Class object of the first
// cell in specified column in the table model.
public Class getColumnClass(int mColIndex) {
int rowIndex = 0;
Object o = getValueAt(rowIndex, mColIndex);
if (o == null)
return Object.class;
} else
return o.getClass();
jTable1 = new javax.swing.JTable(model);
jTable1.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e){
System.out.println("Clicked");
handleTableMouseEvents(e);
//invokeExternalApp("http://www.pixagogo.com");
public void mouseEntered(MouseEvent e){
System.out.println("Entered");
//handleTableMouseEvents(e);
public void mouseExited(MouseEvent e){
System.out.println("Exited");
//handleTableMouseEvents(e);
jTable1.setRowHeight(100);
jTable1.getTableHeader().setReorderingAllowed(false);
jTable1.setBackground(new java.awt.Color(255, 255, 255));
jTable1.setGridColor(new Color(250,250,250));
jTable1.setShowGrid(true);
jTable1.setShowVerticalLines(true);
jTable1.setShowHorizontalLines(false);
jTable1.setFont(new Font("Arial",0,11));
jTable1.setMaximumSize(new java.awt.Dimension(32767, 32767));
jTable1.setMinimumSize(new java.awt.Dimension(630, 255));
jTable1.setPreferredSize(null);
jTable1.setBackground(new Color(255,255,255));
int vColIndex=0;
TableColumn col = jTable1.getColumnModel().getColumn(vColIndex);
int width = 100;
col.setPreferredWidth(width);
//add item to 2nd cell
Vector vec = new Vector();
vec.addElement(null);
dummyPane = new testpane();
vec.addElement(dummyPane);
((DefaultTableModel)jTable1.getModel()).addRow(vec);
jTable1.repaint();
this.getContentPane().add(jTable1);
jTable1.getColumn("Action").setCellRenderer(
new MultiRenderer());
protected void handleTableMouseEvents(MouseEvent e){
TableColumnModel columnModel = jTable1.getColumnModel();
int column = columnModel.getColumnIndexAtX(e.getX());
int row = e.getY() / jTable1.getRowHeight();
testpane contentPane = (testpane)(jTable1.getModel().getValueAt(row, column));
// get the mouse click point relative to the content pane
Point containerPoint = SwingUtilities.convertPoint(jTable1, e.getPoint(),contentPane);
if (column==1 && row==0)
// so the user clicked on the cell that we are bothered about.
MouseEvent ev1 = (MouseEvent)SwingUtilities.convertMouseEvent(jTable1, e, contentPane);
//once clicked on the cell.. we dispatch event to the object in that cell
jTable1.dispatchEvent(ev1);
private void initComponents() {
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-528)/2, (screenSize.height-423)/2, 528, 423);
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit(0);
* @param args the command line arguments
public static void main(String args[]) {
new tableDemo().show();
// Variables declaration - do not modify
// End of variables declaration
class testpane extends JPanel{
public testpane(){
GridBagConstraints gridBagConstraints;
JPanel testpane = new JPanel(new GridBagLayout());
testpane.setBackground(Color.CYAN);
JLabel lblTest = new JLabel("test");
lblTest.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e){
System.out.println("panelClicked");
public void mouseEntered(MouseEvent e){
System.out.println("panelEntered");
public void mouseExited(MouseEvent e){
System.out.println("panelExited");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
testpane.add(lblTest,gridBagConstraints);
this.add(testpane);
class MultiRenderer extends DefaultTableCellRenderer {
JCheckBox checkBox = new JCheckBox();
public Component getTableCellRendererComponent(
JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int column) {
if (value instanceof Boolean) { // Boolean
checkBox.setSelected(((Boolean)value).booleanValue());
checkBox.setHorizontalAlignment(JLabel.CENTER);
return checkBox;
String str = (value == null) ? "" : value.toString();
return super.getTableCellRendererComponent(
table,str,isSelected,hasFocus,row,column);
return (testpane)value;
class MultiEditor implements TableCellEditor {
public MultiEditor() {
public boolean isCellEditable(EventObject anEvent) {return false;}
public boolean stopCellEditing() {return true;}
public Object getCellEditorValue() {return null;}
public void cancelCellEditing() {}
public boolean shouldSelectCell(EventObject anEvent) {return false;}
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
if (value instanceof testpane) { // ComboString
System.out.println("yes instance");
return null;
public void addCellEditorListener(javax.swing.event.CellEditorListener l) {
public void removeCellEditorListener(javax.swing.event.CellEditorListener l) {
}any help on this.. anybody. ?
-
Hi all
i'm new to jsp technolohie and i'm writing a jsp that sends an email on red hat linux
i keep having theses errors .
ps the first jsp is fine but its in the second one i have problems
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred between lines: 33 and 38 in the jsp file: /sending.jsp
Generated servlet error:
/jakarta-tomcat-4.0.3/work/localhost/_/sending$jsp.java:103: '}' expected.
out.write(" \r\n \r\n \r\n \r\n\t \r\n");
^
An error occurred between lines: 38 and 75 in the jsp file: /sending.jsp
Generated servlet error:
/jakarta-tomcat-4.0.3/work/localhost/_/sending$jsp.java:109: Statement expected.
public void postMail( String recipients[ ], String subject, String message , String from) throws MessagingException
^
An error occurred between lines: 75 and 97 in the jsp file: /sending.jsp
Generated servlet error:
/jakarta-tomcat-4.0.3/work/localhost/_/sending$jsp.java:146: Type expected.
out.write(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n<h1> \r\n \r\nMessage sent successfully \r\n \r\n</h1> \r\n\t \r\n</body> \r\n</html> \r\n \r\n \t\t\r\n");
^
3 errors, 1 warning
could u take a look at my codes please so i can know what to do
this is the first jsp in wich a compose the message
<%@ page language="java" %>
<%@ page errorPage="errorpage.jsp" %>
<html>
<head>
<title>JavaMail compose</title>
</head>
<body bgcolor="#ccccff">
<form METHOD=POST ACTION="sending.jsp" >
<input type="hidden" name="send" value="send">
<p align="center">
<b><font size="4" face="Verdana, Arial, Helvetica">
JavaMail Compose Message</font></b>
<p>
<table border="0" width="100%">
<tr>
<td width="16%" height="22">
<p align="right">
<b><font face="Verdana, Arial, Helvetica">To:</font></b></td>
<td width="84%" height="22">
<% if (request.getParameter("to") != null) { %>
<input type="text" name="to" value="<%= request.getParameter("to") %>" size="30">
<% } else { %>
<input type="text" name="to" size="30">
<% } %>
<font size="1" face="Verdana, Arial, Helvetica">
(separate addresses with commas)</font></td></tr>
<tr>
<td width="16%"><p align="right">
<b><font face="Verdana, Arial, Helvetica">From:</font></b></td>
<td width="84%">
<input type="text" name="from" size="30">
<font size="1" face="Verdana, Arial, Helvetica">
(separate addresses with commas)</font></td></tr>
<tr>
<td width="16%"><p align="right">
<b><font face="Verdana, Arial, Helvetica">Subject:</font></b></td>
<td width="84%">
<input type="text" name="subject" size="55"></td></tr>
<tr>
<td width="16%"> </td>
<td width="84%"><textarea name="text" rows="15" cols="53"></textarea></td></tr>
<tr>
<td width="16%" height="32"> </td>
<td width="84%" height="32">
<input type="submit" name="Send" value="Send">
<input type="reset" name="Reset" value="Reset"></td></tr>
</table>
</form>
</body>
</html>
this is the send.jsp to wich the first jsp post its data
<%@ page language="java" %>
<%@ page import = "java.io.*" %>
<%@ page import = "java.net.InetAddress" %>
<%@ page import = "java.util.Properties" %>
<%@ page import = "java.util.Date" %>
<%-- @ page import = "javax.mail.* --%>
<%-- @ page import = "javax.mail.internet.* --%>
<%@ page errorPage="errorpage.jsp" %>
<html>
<head>
<title>JavaMail send</title>
</head>
<body bgcolor="white">
<%
String to= request.getParameter("to");
String from= request.getParameter("from") ;
String subject= request.getParameter("subject") ;
String emailBody= request.getParameter("text") ;
%>
<%
public void postMail( String recipients[ ], String subject, String message , String from) throws MessagingException
boolean debug = false;
//Set the host smtp address
Properties props = System.getProperties();
props.put("mail.smtp.host", mailhost);
// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, null);
//session.setDebug(true);
session.setDebug(debug) ;
// create a message
Message msg = new MimeMessage(session);
msg=emailBody ;
// set the from and to address
InternetAddress addressFrom = new InternetAddress(from);
addressFrom =From ;
msg.setFrom(addressFrom);
InternetAddress[] addressTo = new InternetAddress[recipients.length];
addressTo = To ;
for (int i = 0; i < recipients.length; i++)
addressTo[i] = new InternetAddress(recipients);
msg.setRecipients(Message.RecipientType.TO, addressTo);
// Setting the Subject and Content Type
msg.setSubject(subject);
msg.setContent(message, "text/plain");
Transport.send(msg);
msg.setSentDate(new Date());
%>
<h1>
Message sent successfully
</h1>
</body>
</html>Hi,
Take a look at this page. It has a MessageBoard that also links to a very simple mailing program. It's as basic as you can get, but should help.
http://cswww.essex.ac.uk/TechnicalGroup/TechnicalHelp/Intro.html
best,
kev -
Help needed with Image Events problem
Hi there I'm writing what I thought was a simple script to convert a folder full of images from jpg to tiff. But the script fails when trying to convert the first image in the folder. Instead of converting the image, Preview opens with the image shown and I get this error message: error "The variable ImageRef is not defined." number -2753 from "ImageRef".
I have seen some posts about other people having the same problem, but I haven't seen any solutions.
Here's the script.
on run
tell application "Finder"
set PicturesFolder to ((path to home folder) as string) & "Pictures:SenseCam" as alias
set Photographs to (get entire contents of PicturesFolder) as alias list
end tell
tell application "Image Events"
launch
repeat with Photo in Photographs
if (Photo as string) ends with "jpg" then
set ImageRef to open Photo
save ImageRef in Photographs as TIFF
close ImageRef
end if
end repeat
end tell
tell application "Finder"
repeat with Photo in Photographs
delete Photo
end repeat
end tell
end run
Thanks in advance for any help.
JohnHello
You may try something like the modified code below.
Noticiable changes :
#1 - Removed the parentheses. Your original code won't yield alias list but a list of finder objects, which is the reason why Preview opens the image. (The statment 'open finderObject' behaves the same as double clicking it in Finder)
#2 - Only delete the original jpeg files which are converted to tiff.
#3 - Build new path for converted image.
#4 - Save in new path. (When saving image in a format other than its original format, always save the image to a new file and do not attempt to overwrite the source file.)
cf.
http://www.macosxautomation.com/applescript/imageevents/08.html
on run
tell application "Finder"
set PicturesFolder to (path to home folder as string) & "Pictures:SenseCam:" as alias
set Photographs to get entire contents of PicturesFolder as alias list -- #1
end tell
set DonePhotos to {} -- #2
tell application "Image Events"
launch
repeat with Photo in Photographs
set Photo to Photo's contents
set oldPath to Photo as string
if oldPath ends with ".jpg" then
set newPath to oldPath's text 1 thru -5 & ".tif" -- #3
set ImageRef to open Photo
save ImageRef as TIFF in newPath -- #4
close ImageRef
set end of DonePhotos to Photo -- #2
end if
end repeat
end tell
tell application "Finder"
delete DonePhotos -- #2
end tell
end run
Hope this may help,
H -
Need help on Modifying Jsp Code to establish relationships in iStore.
I am currently working on iStore an internet enabled product
from Oracle.
In iStore one can establish relationships between products like
cross sell , complimentary, substitute, conflict etc. However at
the moment only one relationship works i.e: Related. This is
because this is a bug in iStore. Only the relationship Related
is defined in the jsp. We have been asked to modify the jsp
ibeCCtdItemDetail.jsp
Please find pasted below the jsp which only had the arrays for
related i.e: relitems and service i.e service have added the
array complimentary to establish such a relationship and pasted
the relitems code once again and changed relitems to
complimentary. I am stuck up on this since the past 2 weeks i
would appreciate if anybody could help.
<%@include file="jtfincl.jsp" %>
<!-- $Header: ibeCCtdItemDetail.jsp 115.24 2001/06/16 15:21:05
pkm ship $ -->
<%--
=================================================================
========
| Copyright (c)2000 Oracle Corporation, Redwood Shores, CA
| All rights reserved.
+================================================================
===========
|
| FILE
| ibeCCtdItemDetail.jsp - Item Detail display
|
| DESCRIPTION
| Displays Item Detail page. Item's description, long
description, large
| image, flexfields, available services, and related items
are displayed.
| The list price and best price (selling price) for each of
the Item's
| available units of measure is displayed. Displays Add to
Cart,
| Express Checkout, Configure buttons (if appropriate).
|
| PARAMETERS (SOURCE)
| party Id IN (RequestCtx) - user's party
id
| account Id IN (RequestCtx) - user's
account id
| currency code IN (RequestCtx) - currency code
| item IN (URL) - Item ID
| section IN (URL) - section ID of
section we are
| coming from
(optional)
| item IN (pageContext) - Item ID
| section IN (pageContext) - Section ID
| qty IN (pageContext) - Quantity
entered by user
| uom IN (pageContext) - UOM selected
by user
| errorMsg IN (pageContext) - error message
from buy
| routing page
| * pageContext attributes for "item" and "section" are used
when the URL
| does not contain valid values for "item" and "section"
(such as when an
| error occurred in the buy routing page and the request is
forwarded
| back to this page)
|
| oneclick_obj OUT (pageContext) - OneClick
object containing
| user's
Express Checkout
| preferences
| postingID OUT (pageContext) - Integer
posting Id, for
| iMarketing
integration
| itemIDs OUT (pageContext) - int[] itemIDs
on the page
| (for use by
postings)
| numRequested OUT (pageContext) - Integer
number of postings,
| for
iMarketing integration
| random OUT (pageContext) - Boolean
whether to randomize
| posting
retrieved, for
| iMarketing
integration
| type OUT (HTML form) - "single" (1
item)
| item OUT (HTML form) - Item ID
| refpage OUT (HTML form) -
"ibeCCtdItemDetail.jsp" plus any
| parameters
needed to return
| to this page
in case of error.
| uom OUT (HTML form) - UOM code
selected by user
| qty OUT (HTML form) - quantity
entered by user
| Add to Cart.x OUT (HTML form) - user clicks
Add to Cart
| 1-Click.x OUT (HTML form) - user clicks
Express Checkout
| Configure.x OUT (HTML form) - user clicks
Configure
|
| OBJECTS REFERENCED
| oracle.apps.ibe.catalog.Item
| oracle.apps.ibe.order.OneClick
|
| APIs REFERENCED
| Item.getItemID() - get Item ID
| Item.getDescription() - get item description
| Item.getLongDescription() - get item long description
| Item.isConfigurable() - whether item has
configuration UI set up
| Item.getFlexfields() - get Item flexfield
prompts and values
| Item.getRelatedItems() - get related items and
service items
| Item.getMediaFileName() - get media based on
display context
| OneClick.loadSettingFrDB() - load Express Checkout
settings for
| current user
|
| JSPs REFERENCED
| ibeCCtpPostingI.jsp - set iMarketing
parameters (include)
| ibeCCtpSetItem.jsp - retreive and set item
information (include)
| ibeCCtpItmDspRte.jsp - Item display routing
page (link)
| ibeCCtpBuyRoute.jsp - Buy routing
page (form POST)
| ibeCCtdSctPath.jsp - Path Traversed
Display (include)
| ibeCXpdShowTag.jsp - Express Checkout Tag
Area (include)
| ibapstng.jsp - iMarketing integration
page (include)
|
| ADDITIONAL NOTES
| iMarketing posting ID can be changed by editing file
ibeCCtpPostingI.jsp
|
| HISTORY
| 08/01/2000 auyu Created.
| 04/09/2001 auyu Added compile-time include for retrieving
item
| information
|
+================================================================
=======--%>
<%@page import="oracle.apps.ibe.order.*" %>
<%@page import="oracle.apps.ibe.catalog.*" %>
<%@page import="oracle.apps.ibe.store.*" %>
<%@page import="oracle.apps.jtf.displaymanager.*" %>
<%@page import="oracle.apps.jtf.base.Logger" %>
<%@page import="oracle.apps.jtf.minisites.*" %>
<%@include file="ibeCZzpHeader.jsp" %>
<%@page import="oracle.jdbc.driver.*" %>
<%@page import="java.sql.*" %>
<%-- declaration --%>
<%!
/* Retrieve parent section ids for a given item.
* int itemId - Item whose parent section ids will be retrieved
int getParentSectionId(int itemId)
int parentSectionId = -1;
Connection conn = null;
OraclePreparedStatement stmt = null;
ResultSet rs = null;
try {
BigDecimal minisiteId = RequestCtx.getMinisiteId();
conn = TransactionScope.getConnection();
StringBuffer sql = new StringBuffer(400);
sql.append("select jdsi.section_id ");
sql.append("from jtf_dsp_section_items jdsi, ");
sql.append("jtf_dsp_msite_sct_items jdmsi ");
sql.append("where jdsi.inventory_item_id = ? ");
sql.append("and jdsi.section_item_id =
jdmsi.section_item_id ");
sql.append("and jdmsi.mini_site_id = ? ");
sql.append("and nvl(jdsi.start_date_active, sysdate) <=
sysdate ");
sql.append("and nvl(jdsi.end_date_active, sysdate) >=
sysdate ");
sql.append("and nvl(jdmsi.start_date_active, sysdate) <=
sysdate ");
sql.append("and nvl(jdmsi.end_date_active, sysdate) >=
sysdate");
stmt = (OraclePreparedStatement)conn.prepareStatement
(sql.toString());
stmt.setInt(1, itemId);
stmt.setInt(2, minisiteId.intValue());
stmt.defineColumnType(1, Types.INTEGER);
rs = stmt.executeQuery();
if (rs.next())
parentSectionId = rs.getInt(1);
} catch (Exception e1) {
parentSectionId = -1;
IBEUtil.log("ibeCCtdItemDetail.jsp",
"Caught exception while retrieving parent
section id");
IBEUtil.log("ibeCCtdItemDetail.jsp", e1.getMessage());
} finally
try { if (rs != null) rs.close(); } catch (Exception e2) {}
try { if (stmt != null) stmt.close(); } catch (Exception
e2) {}
try {
if (conn != null) TransactionScope.releaseConnection
(conn);
} catch (Exception e2) {}
return parentSectionId;
%>
<%-- end declaration --%>
<%@include file="ibeCCtpSetItem.jsp"%>
<%
The compile-time inclusion of ibeCCtpSetItem.jsp will declare
and set
the following variables:
boolean bItemLoaded - whether section was
loaded
Item lItem - Item
boolean bItemCanBeOrdered - whether item can be
ordered
String[] uomCodes - Item's UOM Codes
Vector itemSellPriceDisplayVec - vector containing
item's selling
prices in formatted
strings
Vector itemListPriceDisplayVec - vector containing
item's list
prices in formatted
strings
int nPriceDefined - number of prices
defined for the item
Perform the following actions:
Set "itemIds" in the PageContext.REQUEST_SCOPE
Set "item" in PageContext.REQUEST_SCOPE
Set "section" in PageContext.REQUEST_SCOPE
MessageManagerInter lMsgMgr =
Architecture.getMessageManagerInstance();
pageContext.setAttribute("_pageTitle",
lMsgMgr.getMessage
("IBE_PRMT_CT_PRODUCT_DETAILS"),
PageContext.REQUEST_SCOPE);
%>
<%@ include file="ibeCCtpPostingI.jsp" %>
<%@ include file="ibeCZzdTop.jsp" %>
<%@ include file="ibeCZzdMenu.jsp" %>
<%
if (bItemLoaded)
OneClick lOneClickObj;
String xprTagArea = "", confirmXpr = "";
String lBuyRoutePage;
String lSectionPathPage = "";
int sectid = 0;
Item[] services = new Item[0];
Item[] relItems = new Item[0];
Item[] complimentary = new Item[0];
ItemFlexfield[] itemFlexfields = new ItemFlexfield[0];
String lItemImage = "", lItemAddtlInfoFile = "";
StringBuffer lRef = new StringBuffer("ibeCCtdItemDetail.jsp?
item=");
String qty = "", userSelUOM = "";
String errorMsg = "";
//--------------- load express checkout preferences ---------
if (IBEUtil.useFeature("IBE_USE_ONE_CLICK"))
xprTagArea = DisplayManager.getTemplate
("STORE_XPR_TAG_AREA").getFileName();
if (xprTagArea == null)
xprTagArea = "";
confirmXpr = lMsgMgr.getMessage("IBE_PRMT_EXPR_CONFIRM");
if (RequestCtx.userIsLoggedIn()) {
//initialize OneClick if user is logged in
BigDecimal partyId = RequestCtx.getPartyId();
BigDecimal accountId = RequestCtx.getAccountId();
lOneClickObj = new OneClick();
lOneClickObj.loadSettingsFrDB(partyId, accountId);
} // end user express checkout
//------------ set "section", lSectionPathPage --------------
String lSectionId = IBEUtil.nonNull(request.getParameter
("section"));
if (lSectionId.equals(""))
lSectionId =
IBEUtil.nonNull((String)pageContext.getAttribute
("section", PageContext.REQUEST_SCOPE));
if(IBEUtil.useFeature("IBE_USE_SECTION_PATH"))
lSectionPathPage = DisplayManager.getTemplate
("STORE_CTLG_SCT_PATH").getFileName();
try {
sectid = Integer.parseInt(lSectionId);
pageContext.setAttribute("section", String.valueOf
(sectid), PageContext.REQUEST_SCOPE);
} catch (NumberFormatException e) { }
if(lSectionPathPage == null)
lSectionPathPage = "";
lBuyRoutePage = DisplayManager.getTemplate
("STORE_CTLG_BUY_PROCESS_ROUTE").getFileName();
/* if error and forwarded back to this page, get values
selected by user */
qty = IBEUtil.nonNull((String)pageContext.getAttribute
("qty", PageContext.REQUEST_SCOPE));
if (qty.equals(""))
qty = "1";
userSelUOM = IBEUtil.nonNull((String)pageContext.getAttribute
("uom", PageContext.REQUEST_SCOPE));
errorMsg = IBEUtil.nonNull((String) pageContext.getAttribute
("errorMsg", PageContext.REQUEST_SCOPE));
//set ref for returning to this page in case of error
lRef.append(lItem.getItemID());
if (sectid > 0)
lRef.append("§ion=");
lRef.append(sectid);
/* Get Bin Open and Bin Close Images */
String binOpenImg = "", binCloseImg = "";
try {
Media binOpenMedia = DisplayManager.getMedia
("STORE_BIN_OPEN_IMAGE", true);
if (binOpenMedia != null)
binOpenImg = binOpenMedia.getFileName();
} catch (MediaNotFoundException mnfe) {}
if (binOpenImg == null)
binOpenImg = "";
try {
Media binCloseMedia = DisplayManager.getMedia
("STORE_BIN_CLOSE_IMAGE", true);
if (binCloseMedia != null)
binCloseImg = binCloseMedia.getFileName();
} catch (MediaNotFoundException mnfe) {}
if (binCloseImg == null)
binCloseImg = "";
/* Get images, additional info, flexfields, related items,
service items */
lItemImage = lItem.getMediaFileName
("STORE_PRODUCT_LARGE_IMAGE");
lItemAddtlInfoFile = lItem.getMediaFileName
("STORE_PRODUCT_ADDTL_INFO");
// check for defaulting
String defaultFromSection = "Y";
if ("Y".equals(defaultFromSection))
if (lItemImage == null || lItemAddtlInfoFile == null)
try {
int parentSectionId = getParentSectionId
(lItem.getItemID());
Section parentSection = Section.load(parentSectionId);
if (lItemImage == null)
lItemImage = parentSection.getMediaFileName
("STORE_SECTION_SMALL_IMAGE");
if (lItemAddtlInfoFile == null)
lItemAddtlInfoFile = parentSection.getMediaFileName
("STORE_SECTION_ADDTL_INFO");
} catch (Exception e) {}
itemFlexfields = lItem.getFlexfields();
try {
services = lItem.getRelatedItems("SERVICE");
} catch (ItemNotFoundException e) {}
try {
relItems = lItem.getRelatedItems("RELATED");
} catch (ItemNotFoundException e) {}
try {
complimentary = lItem.getRelatedItems("COMPLIMENTARY");
} catch (ItemNotFoundException e) {}
%>
<!-- body section -----------------------------------------------
------------->
<table border="0" width="100%">
<%
if (IBEUtil.showPosting()) {
%>
<!--------- iMarketing integration ----------------->
<tr><td colspan="4" align="center">
<% try {
%>
<jsp:include page="ibapstng.jsp" flush="true" />
<% } catch (Throwable e) {
IBEUtil.log("ibeCCtdItemDetail.jsp", "iMarketing error",
Logger.ERROR);
%>
</td></tr>
<% } //end iMarketing installed
%>
<tr><td> </td>
<%
if(!lSectionPathPage.equals(""))
%>
<td colspan="4" class="smallLink">
<jsp:include page="<%=lSectionPathPage%>" flush="true" />
</td>
<% }
%>
</tr>
<tr><td valign="top"> </td>
<!-- center column ------------------------------------------
------------->
<td valign="top" width="70%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="3">
<span class="pageTitle"><%=lItem.getDescription()%
</span></td></tr>
<tr>
<% if (lItemImage != null) {
%>
<td valign="TOP"><img src="<%=lItemImage%>"></td>
<td valign="TOP" colspan="2"><%
=lItem.getLongDescription()%></td>
<% } else {
%>
<td valign="TOP" colspan="3"><%
=lItem.getLongDescription()%></td>
<% }
%>
</tr>
<% if (lItemAddtlInfoFile != null) {
%>
<tr><td colspan="3"><br>
<jsp:include page="<%=lItemAddtlInfoFile%>"
flush="true" />
</td></tr>
<% }
%>
<tr><td colspan="3"><br></td></tr>
<%
for (int i=0; i < itemFlexfields.length; i++)
String prompt = itemFlexfields.getPrompt();
String value = itemFlexfields[i].getValue();
if (value != null && !value.equals(""))
%>
<tr>
<td align="LEFT" width="20%">
<span class="sectionHeader2"><%=prompt%
</span></td>
<td align="LEFT" colspan="2" width="80%"><%=value%
</td></tr>
<% }
if (services.length > 0)
%>
<tr><td colspan="3"><br></td></tr>
<tr><td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_WARRANTIES")%>
</td>
<td colspan="2" align="left" class="sectionHeaderBlack"
width="80%"><hr>
</td></tr>
<%
for(int i=0; i < services.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td align="left" colspan="2" valign="TOP" width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
(STORE_CTLG_ITM_ROUTE", "item=" + services[i.getItemID()) %>">
<%=services.getDescription()%></A>
</span>
<%=services[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" class="sectionHeaderBlack"> </td>
</tr>
<% } //end loop through services
} // end if services.length > 0
if (relItems.length > 0) {
%>
<tr><td colspan="3"><br></td></tr>
<tr>
<td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
</td>
<td align="left" colspan="2" class="sectionHeaderBlack"
width="80%"><hr></td>
</tr>
<%
for(int i=0; i < relItems.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td colspan="2" align="left" valign="TOP"
width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
("STORE_CTLG_ITM_ROUTE", "item=" + relItems[i].getItemID()) %>">
<%=relItems[i].getDescription()%></A>
</span>
<%=relItems[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" align="RIGHT"
class="sectionHeaderBlack"> </td>
</tr>
<% } // end loop through related items
} // end if relItems.length > 0
%>
</table>
</td>
<%if (complimentary.length > 0) {
%>
<tr><td colspan="3"><br></td></tr>
<tr>
<td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
</td>
<td align="left" colspan="2" class="sectionHeaderBlack"
width="80%"><hr></td>
</tr>
<%
for(int i=0; i < complimentary.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td colspan="2" align="left" valign="TOP"
width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
("STORE_CTLG_ITM_ROUTE", "item=" + complimentary[i].getItemID())
%>">
<%=complimentary[i].getDescription()%></A>
</span>
<%=complimentary[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" align="RIGHT"
class="sectionHeaderBlack"> </td>
</tr>
<% } // end loop through related items
} // end if complimentary.length > 0
%>
</table>
</td>
<!-- right column -------------------------------------------
------------->
<td valign="top" width="20%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<% if (! binOpenImg.equals("")) {
%>
<td><img src="<%=binOpenImg%>"></td>
<% }
%>
<td nowrap class="binHeaderCell" width="100%">
<%
if (!lItem.isConfigurable()) {
%>
<%=lMsgMgr.getMessage("IBE_PRMT_CT_2_WAYS_TO_SHOP")%>
<% } else {
%>
<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIG_PRODUCT")%>
<% }
%>
</td>
<% if (! binCloseImg.equals("")) {
%>
<td><img src="<%=binCloseImg%>"></td>
<% }
%>
</tr>
</table>
</td></tr>
<tr><td class="binColumnHeaderCell">
<table border="0" cellspacing="1" width="100%">
<tr><td class="binContentCell" align="CENTER">
<% /////////////////////////////// error
messages //////////////////////////////
if (!errorMsg.equals("")) {
%>
<table><tr><td align="center" class="errorMessage">
<%=errorMsg%>
</td></tr></table>
<% }
/////////////////////////////// display
form //////////////////////////////////%>
<!--Javascript for express checkout confirmation-->
<script language="JavaScript">
function get_confirmation(form)
if (confirm("<%=confirmXpr%>" ) ) {
form.tmpx.name = '1-Click.x';
form.tmpy.name = '1-Click.y';
form.submit();
return true;
else
return false;
</script>
<form method=POST action="<%=lBuyRoutePage%>">
<input type=hidden name="type" value="single">
<input type=hidden name="item" value="<%=lItem.getItemID()%
"><input type=hidden name="refpage" value="<%=lRef.toString
()%>">
<INPUT TYPE="HIDDEN" NAME="tmpx" VALUE="100">
<INPUT TYPE="HIDDEN" NAME="tmpy" VALUE="100">
<%= RequestCtx.getSessionInfoAsHiddenParam() %>
<%
if ( ! lItem.isConfigurable())
{ // display prices
%>
<table>
<tr><td align ="left" nowrap>
<span class="sectionHeaderBlack">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_LIST_PRICE_COLON")%>
</span>
</td>
<%
for (int i=0; i < uomCodes.length && i <
itemListPriceDisplayVec.size(); i++)
if (uomCodes[i] != null && uomCodes[i].equals
(lItem.getPrimaryUOMCode()))
if (itemListPriceDisplayVec.elementAt(i) != null &&
!itemListPriceDisplayVec.elementAt(i).equals(""))
%>
<td align="right">
<%=itemListPriceDisplayVec.elementAt(i)%
<%=lItem.getPrimaryUOM()%></td>
<% } else {
%>
<td> </td>
<% }
break;
} // end primary uomcode
} // end loop through uoms and list price
%>
</tr>
<tr><td align="left" nowrap>
<span class="sectionHeaderBlack">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_YOUR_PRICE_COLON")%>
</span>
</td>
<td>
<% // display selling price for each uom
if (nPriceDefined > 1) {
//prices defined for multiple UOMs for the item
%>
<select name = "uom">
<%
//--------- loop through uoms and prices ------------------
for (int i=0; i < itemSellPriceDisplayVec.size() && i <
uomCodes.length; i++)
if (itemSellPriceDisplayVec.elementAt(i) != null &&
!itemSellPriceDisplayVec.elementAt(i).equals(""))
boolean bSelectUom = false;
if (uomCodes[i] != null && uomCodes[i].equals
(lItem.getPrimaryUOMCode()))
bSelectUom = true;
if (bSelectUom)
%>
<option value="<%=uomCodes[i]%>" SELECTED>
<% } else {
%>
<option value="<%=uomCodes[i]%>">
<% }
%>
<%=itemSellPriceDisplayVec.elementAt(i)%
<%=IBEUtil.nonNull(lItem.getUOM(uomCodes))%
<%
} // end current uom has price
} //end loop i through uoms and prices
%>
</select>
<% //end more than 1 UOM with price defined for the item
} else {
if (nPriceDefined == 0) { //multiple UOMs, none with
price defined
%>
<input type=hidden name="uom" value="<%
=lItem.getPrimaryUOMCode()%>">
<% } else { // 1 UOM with price defined
String formatSellPrice = "";
String uomWithPrice = "";
for (int i=0; i < uomCodes.length && i <
itemSellPriceDisplayVec.size(); i++)
if (itemSellPriceDisplayVec.elementAt(i) != null &&
!itemSellPriceDisplayVec.elementAt(i).equals(""))
formatSellPrice = (String)
itemSellPriceDisplayVec.elementAt(i);
uomWithPrice = uomCodes;
break;
%>
<input type=hidden name="uom" value="<%=uomWithPrice%>">
<%=formatSellPrice%> <%=IBEUtil.nonNull
(lItem.getUOM(uomWithPrice))%>
<% } //end 1 UOM with price defined
} // end display selling prices
%>
</td></tr></table> <%-- end table for the price --%>
<% } // end non-configurable item
if (bItemCanBeOrdered)
// show quantity and buttons only if item can be ordered
%>
<p><%=lMsgMgr.getMessage("IBE_PRMT_CT_QUANTITY")%>
<input type="TEXT" name="qty" size="3" maxlength="20"
value="<%=qty%>">
</p>
<% if (lItem.isConfigurable()) {
%>
<p>
<input type=hidden name="uom" value="<%
=lItem.getPrimaryUOMCode()%>">
<input type=submit name="Configure.x"
value="<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIGURE")%
"></p>
<% } else {
%>
<p>
<input type=submit name="Add to Cart.x"
value="<%=lMsgMgr.getMessage
("IBE_PRMT_ADD_TO_CART_PRMT_G")%>">
</p>
<%
if (!xprTagArea.equals(""))
%>
<p><%=lMsgMgr.getMessage("IBE_PRMT_CT_OR")%></p>
<p><jsp:include page="<%=xprTagArea%>"
flush="true" /></p>
<% }
} // end item can be ordered
%>
<br>
</form>
</td></tr></table> <%-- end table for bin content and
header --%>
</td></tr></table>
<p> </p>
<p> </p>
</td></tr></table> <%-- end page table --%>
<% } // end item loaded
%>
<%@ include file="ibeCZzdBottom.jsp" %>
<!-- ibeCCtdItemDetail.jsp end -->my bad...didnt think anyone was gonna come in ...lol......nothing populates in the second drop down...I was thinking of making a separate page and just pass the parameter in, bu i never used jsp include.....any suggestions on how to get this thing working??
-
Help - iCal All Day Events Not Syncing on Exchange 2007
When I enter an all day event in iCal it does not sync to my Touch Pro 2 through Exchange 2007. I see the event in OWA and also in Entourage through Sync Services but it simply does not come onto the TP2. All day events entered in Entourage or OWA DO show up in the TP2. Strange but very frustrating because I like to enter my events using Launchbar which works with iCal only.
I don't think I had this problem with 10.5
Greatly Appreciate Help.I've noticed a similar problem. Previously, "all day" events listed correctly in both iCal (on my Mac) and in the calendar on my iPhone. Now, all day events on the iPhone cover the entire day, set to a time of 12 am to 12 pm.
I'm not sure if this is related to 10.6.4 or my recent update to iOS4 on the phone. -
I am trying to design a view page that retrieves records from database,as the data may contain tags like<p>,<b> I am using encodeHtmlTag function to display them as it is .but some text needs to be appeared in bold but if i give the same,b. as input while viewing it is displayed as",b>" since i am using encodeHtmlTag it encodes all the tags .How i can solve this issue.?
as a way i tried using "[ " b " ]" as the tag for bold option ,but i am not able to write proper function to recognize that charater and change that tag to ",b>".
can anyone please help me in this.Thanks a Lot.Since I am at my beginning phase of jsp i am not able to I will be more thankful to you if recode my following code so that the bold option works fine with Italics.
with the following code it encodes all the"<" characters so that if i want to make some part of text as bold while retrieving from database its not working how i can achieve this with the following codes.(r34.jsp).
j11.jsp is the index page from which it forwards to next page r34.jsp which is the display page i.e it retrieves data from database and displays them.i need help in this page only.
j11.jsp:
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="java.sql.*,java.util.*"%>
<%
StringBuffer cname = new StringBuffer();
StringBuffer pname = new StringBuffer();
String nn ="\n\n";
String body1="null";
int cnamesize=0;
int pnamesize=0;
Vector nnn = new Vector();
Vector nnp = new Vector();
Vector nn1 = new Vector();
String selectedclient="null";
String prjname1,prjid;
String xname = request.getParameter("client")!=null?request.getParameter("client"):"";
//String xname1 = request.getParameter("pname1")!=null?request.getParameter("pname1"):"";
String xname2 = request.getParameter("prjid")!=null?request.getParameter("prjid"):"";
//session.setAttribute("prjnamerec", xname1);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<title>Select the Client</title>
<script language="javascript">
function calljsp(){
document.forms[0].action='r34.jsp';
</script>
</head>
<body background="rlogo1.bmp">
<img src="rheader.bmp" width="990" height="150"></img>
<center>
<h2>Login Department</h2>
</center>
<form name="clientselection" method=post>
<h2>Client Selection </h2>
<table>
<tr>
<marquee><%=xname%></marquee>
<td>Client :
<select name="client">
<option value="">SELECT</option>
<% try{
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3307/r", "root", "root");
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("select client from client");
while(rs.next())
String cname1 = rs.getString(1);
nnn.addElement(cname1);
int j1 = nnn.size();
for(int x = 0;x<j1;x++){
String clientName = nnn.elementAt(x)+"";
%>
<option value="<%= clientName %>">
<%= clientName %>
</option>
<% }%>
</select>
<input type="submit" value="View Projects"/>
</td>
</tr>
</table>
<%
if(request.getParameter("client")!=null){
ResultSet rs1 = statement.executeQuery("select distinct(proj_name),proj_id from projects where client='"+xname+"'");
while(rs1.next()){
nn1.addElement(rs1.getString(1));
nnp.addElement(rs1.getString(2));
pnamesize=nn1.size();
for(int p = 0;p<pnamesize;p++){
prjname1=nn1.elementAt(p)+"";
prjid=nnp.elementAt(p)+"";
%>
<table>
<tr valign="top" colspan="2">
<td>
<br/>
<input type="radio" name="prjid" value="<%=prjid%>"><%=prjid%>    <b><%= prjname1%> </b>
<input type="submit" value="Go" onClick="calljsp()"/>
<br/>
</td>
</tr>
</table>
<% if(request.getParameter("pname1")!=null){
//ResultSet rs2 = statement.executeQuery("select * from csrmail where prjname='"+xname1+"' ");
// while(rs2.next()){
}%>
<%}%>
<%}%>
<% connection.close();
}catch(SQLException e){
e.printStackTrace();
%>
</form>
</body>
</html>
r34.jsp
<%!String encodeHtmlTag(String ma){
int malength= ma.length();
StringBuffer mailbuffer=new StringBuffer();
for(int m=0;m<malength;m++)
char c=ma.charAt(m);
if(c=='<')
mailbuffer.append("<");
else if(c=='>')
mailbuffer.append(">");
else if(c=='&')
mailbuffer.append("&");
else if(c=='"')
mailbuffer.append(""");
else if(c==' ')
mailbuffer.append(" ");
else if(c=='\n')
mailbuffer.append("<br>");
else if(c=='[')
c = ma.charAt(m+1);
if(c=='/')
c=ma.charAt(m+2);
char d= ma.charAt(m+3);
if(c=='b'&& d==']')
mailbuffer.append("</b>");
m=m+4;
else if(c=='I'&& d==']')
mailbuffer.append("</I>");
m=m+4;
c = ma.charAt(m);
if(c=='[')
c = ma.charAt(m+1);
if(c=='/')
c=ma.charAt(m+2);
char d2= ma.charAt(m+3);
if(c=='b'&& d2==']')
mailbuffer.append("</b>");
m=m+4;
else if(c=='b')
if(ma.charAt(m+2)==']')
mailbuffer.append("<b>");
m=m+3;
else if(c=='I')
if(ma.charAt(m+2)==']')
mailbuffer.append("<I>");
m=m+3;
c=ma.charAt(m);
mailbuffer.append(c);
else
mailbuffer.append(c);
return mailbuffer.toString();
}%>
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="java.sql.*,java.util.*,import java.util.StringTokenizer"%>
<%
String xname = request.getParameter("client")!=null?request.getParameter("client"):"";
//String xname1 = request.getParameter("pname1")!=null?request.getParameter("pname1"):"";
String xname2= request.getParameter("prjid")!=null?request.getParameter("prjid"):"";
Vector nnn = new Vector();
Vector nn1 = new Vector();
Vector nn2 = new Vector();
Vector nn3 = new Vector();
Vector nn4 = new Vector();
Vector nn5 = new Vector();
//Vector nn6 = new Vector();
StringBuffer sb = new StringBuffer();
StringBuffer redt=new StringBuffer();
StringBuffer qudt=new StringBuffer();
StringBuffer retime=new StringBuffer();
StringBuffer qutime=new StringBuffer();
//StringBuffer nn6=new StringBuffer();
StringTokenizer stok1 ;
String cquery="null";
String creply="null";
String cqdate="null";
String mdate="null";
String crdate="null";
ResultSet rs=null;
ResultSet rs1=null;
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<title>Records Display</title>
<script language="javascript">
function calljsp1(){
document.forms[0].action='j11.jsp';
</script>
</head>
<body background="rlogo1.bmp">
<img src="rheader.bmp" width="990" height="150"></img>
<form name="RecordsDiplay" method=post>
<%String thisclntname12 = xname;%>
<%//String thisprjname12 = xname1;%>
<%String thisprjid12 = xname2;%>
<%//out.println(thisprjname12);%>
<b>ProjectID :</b>
<%out.println(thisprjid12);%>
<table bgcolor="rgb(206,206,255)">
<tr>
<td>
<br>
<br>
<%
try
//String thisprjname = xname1;
String thisclntname = xname;
String thisprjid = xname2;
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3307/r", "root", "root");
/*Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("select mails,mdate from csrmail where proj_id='"+thisprjid+"' ");*/
PreparedStatement ps=connection.prepareStatement("select mails,mdate from csrmail where proj_id=?");
ps.setString(1,thisprjid);
ps.executeQuery();
rs=ps.getResultSet();
while(rs.next())
String cname1 = rs.getString(1);
String mdatte = rs.getString(2);
nnn.addElement(cname1);
nn5.addElement(mdatte);
int j1 = nnn.size();
for(int x = 0;x<j1;x++)
StringBuffer mmdt=new StringBuffer();
StringBuffer mmtime=new StringBuffer();
String mdt1 = nn5.elementAt(x)+"";
String mdt=mdt1.substring(8,10);
String mmonth=mdt1.substring(5,7);
String myear=mdt1.substring(0,4);
String mhh=mdt1.substring(11,13);
String mmm=mdt1.substring(14,16);
String mss=mdt1.substring(17,19);
mmdt.append(mdt+"-"+mmonth+"-"+myear);
mmtime.append(mhh+":"+mmm+":"+mss);
String mails1 = nnn.elementAt(x)+"";
%>
<b>Mail Posted Date</b>
<%out.println(mmdt);%>
<b>Mail Posted Time :</b>
<%out.println(mmtime);%>
<br>
<br>
<b> <style="font-family:verdana;font-size:80%;color:EE82E">Mail : </b>
<%out.println(encodeHtmlTag(mails1));%>
<br>
<br>
<%}%>
</table>
</tr>
</td>
<br>
<%/*ResultSet rs1 = statement.executeQuery("select * from csrquery where proj_id='"+thisprjid+"' ");*/
PreparedStatement ps1=connection.prepareStatement("select * from csrquery where proj_id=?");
ps1.setString(1,thisprjid);
ps1.executeQuery();
rs1=ps1.getResultSet();
while(rs1.next())
cquery = rs1.getString(2);
cqdate = rs1.getString(4);
creply=rs1.getString(5);
String nd = "No Reply";
crdate = rs1.getString(7);
if(rs1.wasNull())
nn4.addElement(nd);
else
nn4.addElement(crdate);
nn1.addElement(cqdate);
nn2.addElement(cquery);
nn3.addElement(creply);
int q=nn1.size();
for(int j=0;j<q;j++)
{%>
<%//out.println(thisprjname12);%>
<b>ProjectID :</b>
<%out.println(thisprjid12);%>
<br>
<br>
<% String qudt1 = nn1.elementAt(j)+"";
String cqdtt=qudt1.substring(8,10);
String cqmonth=qudt1.substring(5,7);
String cqyear=qudt1.substring(0,4);
String cqhh=qudt1.substring(11,13);
String cqmm=qudt1.substring(14,16);
String cqss=qudt1.substring(17,19);
qudt.append(cqdtt+"-"+cqmonth+"-"+cqyear);
qutime.append(cqhh+":"+cqmm+":"+cqss);
String qu = nn2.elementAt(j)+"";
String re = nn3.elementAt(j)+"\n\n";
String b= qu;
String b1 = re;
stok1 = new StringTokenizer (re,"\n");
//System.out.println(creply);
String redt1 = nn4.elementAt(j)+"";
if(redt1.equals("No Reply")){
redt.append(redt1);
retime.append(redt1);
else
String redtt=redt1.substring(8,10);
String remonth=redt1.substring(5,7);
String reyear=redt1.substring(0,4);
String rehh=redt1.substring(11,13);
String remm=redt1.substring(14,16);
String ress=redt1.substring(17,19);
redt.append(redtt+"-"+remonth+"-"+reyear);
retime.append(rehh+":"+remm+":"+ress);
} %>
<br>
<table>
<tr>
<td>
<b>Query Posted Date</b>
<%out.println(qudt);%>
<b>Query Posted Time :</b>
<%out.println(qutime);%>
<br>
<b style="font-family:verdana;font-size:80%;color:green">Query :</b>
<%out.println(encodeHtmlTag(b));
%>
</td>
</tr>
</table>
<br>
<table>
<tr bgcolor="rgb(174,174,200)">
<td>
<b>Last Reply Posted Date</b>
<%out.println(redt);%>
<b>Last Reply Posted Time :</b>
<%out.println(retime);%>
<br>
<%
while(stok1.hasMoreTokens())
out.println(encodeHtmlTag(stok1.nextToken()));%>
<br>
<% }
int qudtsize = qudt.length();
qudt.delete(0,qudtsize);
int qutimesize = qutime.length();
qutime.delete(0,qutimesize);
int redtsize = redt.length();
redt.delete(0,redtsize);
int retimesize = retime.length();
retime.delete(0,retimesize);
%>
<br>
<br>
</td>
</tr>
</table>
<% }
connection.close();
}catch(SQLException e)
e.printStackTrace();
%>
<input type="submit" value="Back" onClick="calljsp1()"/>
</form>
</body>
</html> -
Help needed in JSP Expression Language
Hi all,
I have been working for JSP Expression Language Sample execution since past 5 days. I am using the application server as "Jboss Server" and web server as "Tomcat".
I have been included the jsp-api.jar file in my lib directory of application server as well as source folder's lib directory.
When i am trying to build the source code, i am getting this build error.
[javac] D:\eclipse\workspace\esolvProject\development\src\com\esolv\taglibs\
web\classes\SetSupport.java:186: cannot resolve symbol
[javac] symbol : method getExpressionEvaluator ()
[javac] location: class javax.servlet.jsp.PageContext
[javac] ExpressionEvaluator evaluator = pageContext.getExpressionEvaluator();
In my jsp-api.jar , there are two classes called,
PageContext and JspContext, Both are abstract classes.
PageContext inherits JspContext class. JspContext class have the method getExpressionEvaluator() , returns ExpressionEvaluator.
PageContextImpl - class . it has been called internally when we are trying to call PageContext class. In PageContextImpl class, there is one comment before, the method's definition. that is
" Since JSP 2.0 "
But we have the JSP 2.0 version. But it won't work.
Please help me ont this.
Thanks in Advance,
Natraj>
If the pblm was due to setting the classpath.
The error should be showed for all files in the jar
file.
why i am getting the error for particular method ?
it is accessing the other methods of same class
'JspContext' . but it is not accessing that method.
Thats my question.
Just check that your .jar file is 2.0 compliant and that you do not have any other jars(for servlet or jsp api) in the classpath.
Probably you have an older version of .jar file in your path. So the errors will appear only for those methods that have been added since 2.0, all other methods would compile fine.
Please tell me the jar files to work out the
expression language. so that i can cross check my
list of jars.Hmmm...I dont use jboss. In tomcat the jar file name is jsp-api.jar. But it would have been the same even for jsp1.1, going by jar file names wouldnt help. Just look at your cp as if with a microscope to identify redundant jars.
cheers,
ram. -
Help whit open file!!!!!Urgent
hi
i have 1 great problen whit my servlet.
I use Fop class for create pdf file from xml and class work very well, but i need translate this class in a servlet class and when open file on the fly in browser size of this is equals a 0kb why?
this is may code:
//Java
import java.io.File;
import java.io.OutputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.*;
//JAXP
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Source;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;
//FOP
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
//passaggio di parametri(da xml a pdf)
public class generatePDF extends javax.servlet.http.HttpServlet
public void doGet(HttpServletRequest req,HttpServletResponse response) throws ServletException,IOException
try {
File baseDir = new File("xml/");
baseDir.mkdirs();
File xmlfile = new File(baseDir, "mail.xml");//file in entrata(stream xml)
File xsltfile = new File(baseDir, "carrello.xsl");//file di decodifica xsl
File pdffile = new File("Testpdf.pdf");//file temporaneo d'appoggio pdf
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
OutputStream outi = new java.io.FileOutputStream(pdffile);
outi = new java.io.BufferedOutputStream(outi);
try {
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, outi);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xsltfile));
transformer.setParameter("versionParam", "2.0");
Source src = new StreamSource(xmlfile);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
} finally {
response.setContentType("application/pdf");
response.setHeader("Content-disposition","attachment; filename="+pdffile.getName());
response.flushBuffer();
outi.close();
pdffile.delete();
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
please help my for adjust my code, where is the errors?
i use tomcat 5.5Likely because you are not setting the content length. The rest of the code doesn't look fine however.
At the bottom of this article you can find a valuable downloadFile() snippet which might give new insights: http://balusc.xs4all.nl/srv/dev-jep-pdf.html
By the way, please use normal topic titles. You don't need to put pressure. We don't care less if it is urgent or not. That is totally your own problem. -
Urgent help is needed - JSP & Java beans
Hi,
I am getting the following problem when trying to interact with Javabeans from JSP (DB I use is Cloudscape) :
An exception occurred while interacting with the guestbook database.
The error message was:
Cannot create bean of class proj.beans.UserDataBean
Please try again later
The problem probably occurs in following line:
status = guestData.checkUser(userName,emailName);
where guestData represents a Javabean class.
The strangest thing is that sometimes, suddenly, the program is working OK without this Error Message but when it occurs I don't know the reason and how to solve it.
Please advise...
Thanks a lot.Can you copy the entire stack trace and post it? It would probably help.
-
Need Help with scope in event handlers in AS 2.0!
I am trying to integrate an XML loading script into my FLA. I
got the script from a book (I'm learning this) and it worked fine
when in a timeline frame (loaded all perfectly well), but when I
put it into an AS 2.0 class (which I'd been using with hardcoded
data for testing) all fails miserably. I'm trying to get the loaded
XML data processed with another class private function when the
onLoad event comes from loading the XML, but this second
function never gets called. All just fails silently. PLUS I'm
trying to store the loaded data into two arrays which are class
properties so that I can access the data later. They are not
accessible. If this seems muddled it's only because I've been
banging my head against this for 2 hours. I've read Moock, and then
I went to Macromedia's online help -- and you will see in my code
that I tried to set up an "owner" variable to clarify scope. It
didn't.
Basically: how does one handle scope of other class functions
AND class properties from within an event handler in the class?
As a very important bonus question: is there a way to set up
eventListeners and callback functions
between classes, or is this verboten?
Please help if you can -- I know it's obvious to you, and
soon perhaps to me --
Thanks -- Robert
(Code follows)Thanks -- indeed a crucial call might be missing. I was doing
this until 3 yesterday morning.
Would this be the correct sample code to use? :
http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm ?context=Flash_MX_2004&file=00000846.html
It seems to work (although someone cautions in the page
comments that it doesn't).
Part of my trouble in working with AS 2.0 is that I feel I
shouldn't have to do such complicated things (Delegate classes,
etc) in order to get simple things done (loading XML files). This
is not a complaint per se -- rather I feel that I must be missing
something, that it is my inexperience that is causing me to bend
through so many hoops: programming "should" be elegant and simple.
So, any links helpful. Thanks. -
Help white screen no dock, no screen. no desk top!!!!
I have no screen, no dock, no desk top. nothing just a white screen. Can anyone help me restore I don't know how to fix this problem
Help please!!!!!Ok downloaed osx lion and icloud. now my mac starts up and goes to a white screen. no dock no desk top nothing. it's like a great big white cloud nothing else. I have used the option f11 key to get system preferances to come up and everything checks out. If I pull up recent under system and click on iphoto I get a white screen, If I click on icloud I get a white screen. If I click on Icloud on apple support I get a screen with the sign in screen jumping around. I'm so brain dead trying to figure this out. Please if you can help!! Much thanks!
Maybe you are looking for
-
Replacement hard drive for T23
I've got a 2647-HU8 and need a comatible replacement drive. It had a 4200 rpm, 40 gb drive. ATA-6. I parts list gives the number 08K9767 or a Travelstar 4K40. The Travelstar 4K40 is no longer available. Do I go with a 5K40? Thanks in advance. ThinkPa
-
I recently got rid of an old computer that I was using my iPod with, and I want to take all of my songs from iPod and put them on my new one, rather than ripping all of my CDs over again, and having to pay for all of my downloads again, but I know if
-
My comuter crashed how do I sybc my ipod with days of music
My computer crashed- I do I sync my ipod that has DAYS of music that I loaded myself from CDs I owned?
-
Hi, I´m going to do a system copy, but I´ve the next doubts: -It´s necessary to install the target system before the import of the source system or the target system is created with the sapinst and the import of the database image? -Where are the mai
-
How can I deauthorize old PC's as I am over 5
I had my laptop crash yesterday, got a new PC and I am trying to sync for the first time. I found out I cannot authorize this PC as my old laptop was #5. I had old work PC's at an old place of employment, a home PC that is dead and gone, and the lapt