Help with code to send to PHP script
For some reason my ActionScript code isn't working correctly. Would someone please tell me if this looks valid to send to a php processing script?
var submitListener:Object = new Object();
submitListener.click = function(evt:Object) {
fname2 = fname.text;
lname2 = lname.text;
var send_lv:LoadVars = new LoadVars();
send_lv.fname = fname.text;
send_lv.lname = lname.text;
send_lv.email = email.text;
send_lv.dept = dept.text;
send_lv.campus = campus.text;
send_lv.uaid = uaid.text;
send_lv.phone = phone.text;
send_lv.send("process.php", _self, "POST");
gotoAndStop("certificate");
thanks!
-sage
that's not valid.
try:
var submitListener:Object = new Object();
submitListener.click = function(evt:Object) {
fname2 = fname.text;
lname2 = lname.text;
var receive_lv:LoadVars=new LoadVars()
var send_lv:LoadVars = new LoadVars();
send_lv.fname = fname.text;
send_lv.lname = lname.text;
send_lv.email = email.text;
send_lv.dept = dept.text;
send_lv.campus = campus.text;
send_lv.uaid = uaid.text;
send_lv.phone = phone.text;
send_lv.send("process.php", receive_lv, "POST");
gotoAndStop("certificate");
Similar Messages
-
Hey there,
I've just started programming J2ME using Netbeans using the java mobility pack, trying to create a program which interacts with a php webserver..
I created some code which accessed my php script on my server and returned the contents of the page back, and successfully got it working. However, i did a bit of treaking, and then tried to remove it all.. and now my code won't work. I've been examining it for a good hour and can't seem to find the error! It's annoying me pretty badly.. I'm not liking J2ME already.
Could someone please look at my code and help me out? I really really want to get this working..
* VisualMidlet.java
* Created on 26 October 2007, 19:37
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
* @author Will
public class VisualMidlet extends MIDlet{
/** Creates a new instance of VisualMidlet */
private Display display;
private Command Submit;
private Command okCommand2;
private Command Submit1;
private Form Form1;
private StringItem stringItem1;
String url = "http://people.bath.ac.uk/wal20/testGET.php?type=3";
public VisualMidlet() {
System.out.println("initialized");
display = Display.getDisplay(this);
Connect();
public void startApp() {
public void Connect(){
try {getViaStreamConnection(url);}
catch (IOException e) {
System.out.println("IOException " + e);
e.printStackTrace();
public void getViaStreamConnection(String url) throws IOException {
StreamConnection streamConnection = null; //declares a stream connection
InputStream inputStream = null; // declares an input Stream
StringBuffer b = new StringBuffer();
TextBox textBox = null;
try {
System.out.println("Establishing stream");
streamConnection = (StreamConnection)Connector.open(url);
System.out.println("Stream established");
inputStream = streamConnection.openInputStream();
int ch;
while((ch = inputStream.read()) != -1) {
b.append((char) ch);
textBox = new TextBox("Simple URL Fetch", b.toString(), 1024, 0);
} finally {
if(inputStream != null) {
inputStream.close();
if(streamConnection != null) {
streamConnection.close();
display.setCurrent(textBox);
public void pauseApp() { }
public void destroyApp(boolean unconditional) { }
/** This method initializes UI of the application.
private void initialize() {
getDisplay().setCurrent(get_Form1());
* This method should return an instance of the display.
public Display getDisplay() {
return Display.getDisplay(this);
* This method should exit the midlet.
public void exitMIDlet() {
getDisplay().setCurrent(null);
destroyApp(true);
notifyDestroyed();
/** This method returns instance for Submit component and should be called instead of accessing Submit field directly.
* @return Instance for Submit component
public Command get_Submit() {
if (Submit == null) {
// Insert pre-init code here
Submit = new Command("Submit", Command.OK, 1);
// Insert post-init code here
return Submit;
/** This method returns instance for okCommand2 component and should be called instead of accessing okCommand2 field directly.
* @return Instance for okCommand2 component
public Command get_okCommand2() {
if (okCommand2 == null) {
// Insert pre-init code here
okCommand2 = new Command("Ok", Command.OK, 1);
// Insert post-init code here
return okCommand2;
/** This method returns instance for Submit1 component and should be called instead of accessing Submit1 field directly.
* @return Instance for Submit1 component
public Command get_Submit1() {
if (Submit1 == null) {
// Insert pre-init code here
Submit1 = new Command("Submit", Command.OK, 1);
// Insert post-init code here
return Submit1;
/** This method returns instance for Form1 component and should be called instead of accessing Form1 field directly.
* @return Instance for Form1 component
public Form get_Form1() {
if (Form1 == null) {
// Insert pre-init code here
Form1 = new Form(null, new Item[] {get_stringItem1()});
// Insert post-init code here
return Form1;
/** This method returns instance for stringItem1 component and should be called instead of accessing stringItem1 field directly.
* @return Instance for stringItem1 component
the code for the php script is:
<?php
$response = "Hello";
if (isset($_GET)) {
switch ($_GET["type"]) {
case 1: $response = "Good Morning"; break;
case 2: $response = "Good Afternoon"; break;
case 3: $response = "Good Evening"; break;
default: $response = "Hello"; break;
echo $response;
?>
I would be grateful for any reply
Thank you in advance
-Willsorry! i'll repost the code in code format
* VisualMidlet.java
* Created on 26 October 2007, 19:37
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
* @author Will
public class VisualMidlet extends MIDlet{
/** Creates a new instance of VisualMidlet */
private Display display;
private Command Submit;
private Command okCommand2;
private Command Submit1;
private Form Form1;
private StringItem stringItem1;
String url = "http://people.bath.ac.uk/wal20/testGET.php?type=3";
public VisualMidlet() {
System.out.println("initialized");
display = Display.getDisplay(this);
Connect();
public void startApp() {
public void Connect(){
try {getViaStreamConnection(url);}
catch (IOException e) {
System.out.println("IOException " + e);
e.printStackTrace();
public void getViaStreamConnection(String url) throws IOException {
StreamConnection streamConnection = null; //declares a stream connection
InputStream inputStream = null; // declares an input Stream
StringBuffer b = new StringBuffer();
TextBox textBox = null;
try {
System.out.println("Establishing stream");
streamConnection = (StreamConnection)Connector.open(url);
System.out.println("Stream established");
inputStream = streamConnection.openInputStream();
int ch;
while((ch = inputStream.read()) != -1) {
b.append((char) ch);
textBox = new TextBox("Simple URL Fetch", b.toString(), 1024, 0);
} finally {
if(inputStream != null) {
inputStream.close();
if(streamConnection != null) {
streamConnection.close();
display.setCurrent(textBox);
public void pauseApp() { }
public void destroyApp(boolean unconditional) { }
/** This method initializes UI of the application.
private void initialize() {
getDisplay().setCurrent(get_Form1());
* This method should return an instance of the display.
public Display getDisplay() {
return Display.getDisplay(this);
* This method should exit the midlet.
public void exitMIDlet() {
getDisplay().setCurrent(null);
destroyApp(true);
notifyDestroyed();
/** This method returns instance for Submit component and should be called instead of accessing Submit field directly.
* @return Instance for Submit component
public Command get_Submit() {
if (Submit == null) {
// Insert pre-init code here
Submit = new Command("Submit", Command.OK, 1);
// Insert post-init code here
return Submit;
/** This method returns instance for okCommand2 component and should be called instead of accessing okCommand2 field directly.
* @return Instance for okCommand2 component
public Command get_okCommand2() {
if (okCommand2 == null) {
// Insert pre-init code here
okCommand2 = new Command("Ok", Command.OK, 1);
// Insert post-init code here
return okCommand2;
/** This method returns instance for Submit1 component and should be called instead of accessing Submit1 field directly.
* @return Instance for Submit1 component
public Command get_Submit1() {
if (Submit1 == null) {
// Insert pre-init code here
Submit1 = new Command("Submit", Command.OK, 1);
// Insert post-init code here
return Submit1;
/** This method returns instance for Form1 component and should be called instead of accessing Form1 field directly.
* @return Instance for Form1 component
public Form get_Form1() {
if (Form1 == null) {
// Insert pre-init code here
Form1 = new Form(null, new Item[] {get_stringItem1()});
// Insert post-init code here
return Form1;
/** This method returns instance for stringItem1 component and should be called instead of accessing stringItem1 field directly.
* @return Instance for stringItem1 component
} -
Combo box and Check box..help with code please?
Here is my problem...i have a list of check boxes and according to which one is checked, i need combo boxes to populate different choices.
as an easy example im only using 2 check boxes and two combo boxes.
the check boxes are named Choice 1or2 with export values of 1 and 2
the Combo Boxes are named List A and List B..
both containing options that say you checked box 1 and you checked box 2
any help would be greatly appreciatedImplode wrote:
"Help with code please."
In the future, please use a meaningful subject. Given that you're posting here, it's kind of a given that you're looking for help with the code. The whole point of the subject is to give people a high level idea of what KIND of help with what KIND of code you need, so they can decide if they're interested and qualified to help.
Exception in thread "main" java.lang.NumberFormatException: For input string: "fgg"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at assignment1.Game.Start(Game.java:120)
at assignment1.RunGame.main(RunGame.java:18)This error message is telling you exactly what's wrong. At line 120 of Game.java, in the Start method (which should start with lowercase "s" to follow conventions, by the way), you're calling Integer.parseInt, but "fgg" is not a valid int. -
Developers Toolbox: MX Send Email php script generator
Hi,
I read Foundation PHP for Dreamweaver 8 (I have CS4
Dreamweaver but it’s still a good book).
In it, the author claims, that InterAKT has a product called
“MX Send Email” in the MX Kollection 3 suite of
Dreamweaver extensions, which automates the process of writing the
php script to process and send web email form data from forms
created in Dreamweaver, to the mail server. I went to their site
and it re directs to Adobe, and Adobe claims that they acquired
InterAKT a few years ago and included the above product in the
Developers Toolbox.
I downloaded the developers toolbox yesterday and for the
life of me I can’t figure out where I could find it or how it
works, it's very frustrating. Which makes me wonder if I should
plunk down an extra 300 bucks for the developers toolbox,
documentation is spotty at best – I can’t find any
books or discussion forums on the developers toolbox on how to use
this feature in the dev toolbox. No one seems to know anything
about it on the Extensions forum. Can someone give me some info
about this?
It seems to me there should be a simple way to generate some
PHP script for feedback forms created in Dreamweaver, especially
with the Developers toolkit.My other alternative is to buy a third
party extension to generate the scripts for 30 bucks, but if the
toolkit has it somewhere, where is the documentation or tutorial on
the adobe web site (which I dug for almost all day yesterday?
The Dev Toolkit has an option to insert a Captcha image so I
assume it's possible to do that too...
Or, Are there any on line tutorials which instruct on how to
create an email "Contact Us" form with Dreamweaver 4, which
includes info on writing the php script to process form data and
send it to mail server? If so can anyone direct me to it? Adobe has
one for Dreamweaver CS 3 on their site - but even that section of
the adobe site is not updated for CS4 and the tutorial even claims
that the Developers toolbox is not yet compatible with DW CS4 yet,
which contradicts the system requirements for the Dev Toolbox when
one downloads it.Mr. Powers,
Thanks for the info! BTW I really enjoyed reading your book a
few years ago, it really helped me to learn Dreamweaver back then.
I’m quite rusty now and trying to get back up to speed after
not using it for a few years. Sorry to hear about the ADDT thingy.
Thanks for the thread DWFAQ.info, I bookmarked the threads
and will read them over the weekend. Thanks for the Dreamweaver
Developer Toolbox link too! I had no idea that there was a Dev
toolbox forum I was looking for it on the adobe site for two days,
now I just noticed it has been included on the main index page, I
don’t think it was posted there yesterday but maybe I missed
it.
Does anyone know if there are any books possibly in the works
or being planned for the toolbox?
Also I’m kind of curious now, are the mixed feelings
about the toolbox because it (appears but I’m no expert), to
be a bit less user friendly for the average web designer? Either
that or just not enough documentation yet?
I had never heard about the toolbox until I bought my CS4
suite a few weeks ago. From above -
quote:
"what has now become Adobe Dreamweaver Developer Toolbox"
- what
was the toolbox? Is the toolbox the former InterAKT suite or
extensions? Or was it a mix of theirs and/or other extension
authors stuff? Did adobe buy up a few companies and add their own
stuff to it and market it as the toolbox?
When was the toolbox first released? Recently? Did Adobe
create it out of the merger with InterAkt? I’ve been out of
the web design loop for a few years, just trying to catch up on
what’s been going on lately. -
FM with code to send a simple text mail to external ID
Hi All,
I need a FM with code if possible to send a simple text mail to an external e-mail id or distribution list. I tried using the FM SO_NEW_DOCUMENT_ATT_SEND_API1 and was successfull in sending mail. But it requires attachment.
I need help to send mail without attachment with code.
All configurations done at my end.
Thanks
Anirban BhattacharjeeHi Anirban,
Please check this sample code.
* Email ITAB structure
DATA: BEGIN OF EMAIL_ITAB OCCURS 10.
INCLUDE STRUCTURE SOLI.
DATA: END OF EMAIL_ITAB.
DATA: T_EMAIL LIKE SOOS1-RECEXTNAM. "EMail distribution list
CONSTANTS: C_EMAIL_DISTRIBUTION LIKE SOOS1-RECEXTNAM VALUE
[email protected],[email protected].
* Initialization
REFRESH EMAIL_ITAB.
* Populate data
EMAIL_ITAB-LINE = Email body text 1.
APPEND EMAIL_ITAB.
EMAIL_ITAB-LINE = Email body text 2.
APPEND EMAIL_ITAB.
T_EMAIL = C_EMAIL_DISTRIBUTION.
* --- EMAIL FUNCTION ---------------------------------------------------
* REQUIRMENTS:
* 1) The user running the program needs a valid email address in their
* address portion of tx SU01 under external comms -> SMTP -> internet
* address.
* 2) A job called SAP_EMAIL is running with the following parameters:
* Program: RSCONN01 Variant: INT User: XXX
* This program moves mail from the outbox to the mail server using
* RFC destination: SAP_INTERNET_GATEWAY_SERVER
* INTERFACE:
* 1) APPLICATION: Anything
* 2) EMAILTITLE: EMail subject
* 3) RECEXTNAM: EMail distribution lists separated by commas
* 4) TEXTTAB: Internal table for lines of the email message
* EXCEPTIONS:
* Send OK = 0 otherwise there was a problem with the send.
CALL FUNCTION 'Z_SEND_EMAIL_ITAB'
EXPORTING
APPLICATION = 'EMAIL'
EMAILTITLE = 'Email Subject'
RECEXTNAM = T_EMAIL
TABLES
TEXTTAB = EMAIL_ITAB
EXCEPTIONS
OTHERS = 1.
Function Z_SEND_EMAIL_ITAB
*"*"Local interface:
*" IMPORTING
*" VALUE(APPLICATION) LIKE SOOD1-OBJNAM
*" VALUE(EMAILTITLE) LIKE SOOD1-OBJDES
*" VALUE(RECEXTNAM) LIKE SOOS1-RECEXTNAM
*" TABLES
*" TEXTTAB STRUCTURE SOLI
*- local data declaration
DATA: OHD LIKE SOOD1,
OID LIKE SOODK,
TO_ALL LIKE SONV-FLAG,
OKEY LIKE SWOTOBJID-OBJKEY.
DATA: BEGIN OF RECEIVERS OCCURS 0.
INCLUDE STRUCTURE SOOS1.
DATA: END OF RECEIVERS.
*- fill odh
CLEAR OHD.
OHD-OBJLA = SY-LANGU.
OHD-OBJNAM = APPLICATION.
OHD-OBJDES = EMAILTITLE.
OHD-OBJPRI = 3.
OHD-OBJSNS = 'F'.
OHD-OWNNAM = SY-UNAME.
*- send Email
CONDENSE RECEXTNAM NO-GAPS.
CHECK RECEXTNAM <> SPACE AND RECEXTNAM CS '@'.
*- for every individual recipient send an Email
* (see OSS message 0120050409/0000362105/1999)
WHILE RECEXTNAM CS ','.
PERFORM INIT_REC TABLES RECEIVERS.
READ TABLE RECEIVERS INDEX 1.
RECEIVERS-RECEXTNAM = RECEXTNAM+0(SY-FDPOS).
ADD 1 TO SY-FDPOS.
SHIFT RECEXTNAM LEFT BY SY-FDPOS PLACES.
MODIFY RECEIVERS INDEX 1.
PERFORM SO_OBJECT_SEND_REC
TABLES TEXTTAB RECEIVERS
USING OHD.
ENDWHILE.
*- check last recipient in recipient list
IF RECEXTNAM <> SPACE.
PERFORM INIT_REC TABLES RECEIVERS.
READ TABLE RECEIVERS INDEX 1.
RECEIVERS-RECEXTNAM = RECEXTNAM.
MODIFY RECEIVERS INDEX 1.
PERFORM SO_OBJECT_SEND_REC
TABLES TEXTTAB RECEIVERS
USING OHD.
ENDIF.
ENDFUNCTION.
* FORM SO_OBJECT_SEND_REC *
FORM SO_OBJECT_SEND_REC
TABLES OBJCONT STRUCTURE SOLI
RECEIVERS STRUCTURE SOOS1
USING OBJECT_HD STRUCTURE SOOD1.
DATA: OID LIKE SOODK,
TO_ALL LIKE SONV-FLAG,
OKEY LIKE SWOTOBJID-OBJKEY.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
EXTERN_ADDRESS = 'X'
OBJECT_HD_CHANGE = OBJECT_HD
OBJECT_TYPE = 'RAW'
OUTBOX_FLAG = 'X'
SENDER = SY-UNAME
IMPORTING
OBJECT_ID_NEW = OID
SENT_TO_ALL = TO_ALL
OFFICE_OBJECT_KEY = OKEY
TABLES
OBJCONT = OBJCONT
RECEIVERS = RECEIVERS
EXCEPTIONS
ACTIVE_USER_NOT_EXIST = 1
COMMUNICATION_FAILURE = 2
COMPONENT_NOT_AVAILABLE = 3
FOLDER_NOT_EXIST = 4
FOLDER_NO_AUTHORIZATION = 5
FORWARDER_NOT_EXIST = 6
NOTE_NOT_EXIST = 7
OBJECT_NOT_EXIST = 8
OBJECT_NOT_SENT = 9
OBJECT_NO_AUTHORIZATION = 10
OBJECT_TYPE_NOT_EXIST = 11
OPERATION_NO_AUTHORIZATION = 12
OWNER_NOT_EXIST = 13
PARAMETER_ERROR = 14
SUBSTITUTE_NOT_ACTIVE = 15
SUBSTITUTE_NOT_DEFINED = 16
SYSTEM_FAILURE = 17
TOO_MUCH_RECEIVERS = 18
USER_NOT_EXIST = 19
X_ERROR = 20
OTHERS = 21.
IF SY-SUBRC <> 0.
RAISE OTHERS.
ENDIF.
ENDFORM.
* FORM INIT_REC *
FORM INIT_REC TABLES RECEIVERS STRUCTURE SOOS1.
CLEAR RECEIVERS.
REFRESH RECEIVERS.
MOVE SY-DATUM TO RECEIVERS-RCDAT .
MOVE SY-UZEIT TO RECEIVERS-RCTIM.
MOVE '1' TO RECEIVERS-SNDPRI.
MOVE 'X' TO RECEIVERS-SNDEX.
MOVE 'U-' TO RECEIVERS-RECNAM.
MOVE 'U' TO RECEIVERS-RECESC.
MOVE 'INT' TO RECEIVERS-SNDART.
MOVE '5' TO RECEIVERS-SORTCLASS.
APPEND RECEIVERS.
ENDFORM.
Hope this will help.
Regards,
Ferry Lianto -
Trouble with the header content of php script - return wrong character: ?�?
Hello everybody!
I have one problem with reading of content of php's return text value.
Ok in php script was programmed something like this:
===========================================
$new1 = ereg_replace(".*OUTPUT url=\"(.{40,70})\" ?/>.*", "\\1",$XMLResponse);
$size = strlen($new1);
header("Content-Type: text/plain");
header("Content-Length: " .$size);
echo $new1;
==========================================
$new1 includes url address to picture.
Ok, in my java applet I'm using the method readLine() of DataInputStream Class, where I'm reading the return text value of the mentioned php script. The code is here:
==========================================
try {
dis = new DataInputStream(url.openStream());
str = dis.readLine();
} catch (IOException e2) {
==========================================
but response is a text plus this kind of characters in beginning : ?�?
What the trouble there? Thank you
Jan Zitniak :)Hello,
thank you for your idea, but I resolved problem with this code:
URL urlReal = null;
try {
urlReal = new URL (str); // convert String to URL
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
In that code I "converted" a string to url where the string happened a real URL address.
Jan :) -
I desperately need help with Mail, specifically sending
For Starters: I am on OSX 10.9.2 and am trying to use mail 7.2.
https://discussions.apple.com/post!input.jspa?container=2998&containerType=14&qu estion=I+desperately+need+help+with+Mail%2C+specifically+sending
I cannot send. I have been at this for hours and hours and hours. Here are the details.
my mail server however is s1.sistercompany.net
I can receive email just fine. I can also send mail just find having set this up on my iphone and also in thunderbird (which i hate hate hate hate hate hate hate, which is why I am desperate to set up mail)
The settings in thunderbird are as follows:
Servername: s1.sistercompany.net
port: 465
Authentication method: normal password
Connection Security: SSL/TLS
However, I just can't get this to work in Mail. When I write an email and hit send I get a popup that says:
Cannot send message using the server s1.sistercompany.net
The certifcate for this server is invalid.
Now, my tech guy says yeah the certifacte is invalid because you are going through sistercompany server, there should be some way to just accept the certifcate anyway (but he has never used mail before).
So I have serached around and come up with this: http://support.apple.com/kb/PH11706
Which tells me to use the verify certificate dialogue, which I would do except there is no verify certificate dialog. Any thoughts?
<Email Edited by Host>I don't have a problem watching the Lost episode on abc.com, using a stock MacBook with 512MB RAM. I don't know what technology abc.com uses in their viewer, but I have Flip4Mac and the latest version of Flash player installed.
-
Can somebody help me get rid of the following compile errors:
coreservlets/OrderPage.java:61: setNumOrdereed(int, int) in coreservlets.ShoppingCart
cannont be applied to (java.lang.String,int)
cart.setNumOrdered(recordingid, numItems);
.\coreservlets\shoppingCart.java:44 cannot resolve symbol
symbol : variable recordingid
location: class coreservlets.ShoppingCart
if (order.getrecordingid() == (recordingid)) {
.\coreservlets\ShoppingCart.java:49: cannot resolve symbol
symbol : variable recordingid
location: class coreservlets.ShoppingCart
itemOrder new order = new ItemOrder(Catalog.getItem(recordingid));I know that not very helpful with out the code but the code is very big so if anyone wants me to post extracts from the code please tell me.Thank you i put that code in but now get the following:
coreservlets/OrderPage.java:40: incompatible types
found : java.lang.strgin
required: int int recordingid = request.getParameter("recordingid")!=null?request.getParameter("recordingid"):1;
^/code]
coreservlets/OrderPage.java:48: addItem(java.lang.String) in coreservlets.ShoppingCart cannot be applied to (int)
cart.additem(recordingid);
.\coreservlets\AhoppingCart.java:44: cannot resolve symbol
symbol: variable recordingid
location: class coreservlets.ShoppingCart
if (order.getrecordingid() == (recordingid)) {
.\coreservlets\AhoppingCart.java:49: cannot resolve symbol
symbol: variable recordingid
location: class coreservlets.ShoppingCart
ItemOrder newOrder = new ItemOrder(Catalog.getItem(recordingid));
4 errors.
Also could you explain what the line you added to the code means:
!=null?request.getParameter("recordingid"):1;
!=null?request.getParameter("numItems"):"1";and how come you got rid of if (recordingid != null) {Thanks for any help with these errors
OK I HAVE GOT RID OF ALL THE ERRORS APART FROM THE TOP ONE:
code]coreservlets/OrderPage.java:40: incompatible types
found : java.lang.strgin
required: int
int recordingid = request.getParameter("recordingid")!=null?request.getParameter("recordingid"):1;
/code]
Message was edited by:
ajrobson -
Urgent-Need help with code for Master data enhancement
hi Experts,
I have appended YMFRGR field(Table MARC) to 0MAT_PLANT_ATTR datasource.
The key fields in the MARC table are MATNR and WERKS.Can anybody help with the user exit to populate this field,as am pretty new to ABAP.
Thanks in advanceHi,
go through this link which has the similar problem:
https://forums.sdn.sap.com/click.jspa?searchID=1331543&messageID=2794783
hope it helps.
Thanks,
Amith -
Help with code to print HTML in Java 5
Hi,
The following code works and runs successfully..
However, the printing in Java 1.4.2_03 is better than Java 5 (latest version).
i.e in particular the characters are not monospaced compared with compiling with Java 1.4.2_03. e.g si so ss squashed together.
This issue does not seem to occur when running the same code in Java 1.4.2_03. (I haven't tried other 1.4.2 java versions).
Any help would be appreciated. We really need this working under Java 5 or bust.
Here is the complete listing ... PrintHtml.java (it uses the DocumentRenderer)
and following this is the input file.
import javax.swing.text.html.HTMLDocument;
import java.net.URL;
import java.net.MalformedURLException;
import java.io.IOException;
import java.io.DataInputStream;
import java.io.InputStream;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.html.*;
import java.lang.reflect.*;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import javax.swing.JEditorPane;
import javax.swing.text.Document;
import javax.swing.text.PlainDocument;
import javax.swing.text.View;
import javax.swing.text.html.HTMLDocument;
import java.awt.*;
import javax.swing.*;
import java.awt.print.*;
import java.text.ParseException;
public class PrintHtml {
* Utility helper to convert HTML Text to HTML Document.
* @param baseUrl URL to be used in order
* to resolve relative HTML references, in lieu of an
* HTML BASE tag. May be null, if not required or HTML
* BASE tag is to be used.
* @see jbox.view.jfx.JboxHtmlEditor
* @see jbox.utility.JboxPrint
* @see jbox.utility.JboxPrintUtil
public static HTMLDocument htmlTextToHtmlDoc(String htmlText, URL baseUrl)
try
// JboxHtmlEditorKit editorKit = new JboxHtmlEditorKit();
HTMLEditorKit editorKit = new HTMLEditorKit();
HTMLDocument doc = (HTMLDocument)editorKit.createDefaultDocument();
if (baseUrl != null)
try
doc.setBase(baseUrl);
catch(Exception e)
//JboxTraceManager.trace(e);
StringReader reader = new StringReader(htmlText);
editorKit.read(reader, doc, 0);
return doc;
catch(Exception e)
//JboxTraceManager.trace(e);
return null;
public static void main(String[] args) {
System.out.println("printing...");
HTMLDocument x = new HTMLDocument();
DocumentRenderer invoice = new DocumentRenderer();
//invoice.setScaleWidthToFit(false);
String s = "";
try {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("mark.html"));
InputStreamReader in = new InputStreamReader(bis , "ASCII");
StringWriter sw = new StringWriter();
while (true) {
int datum = in.read();
if (datum == -1) break;
sw.write(datum);
in.close();
s = sw.toString();
System.out.println("s="+s);
catch (IOException e) {
System.err.println(e);
HTMLDocument htmldoc = htmlTextToHtmlDoc(s, null);
invoice.print(htmldoc);
// the good old infamous DocumentRenderer.
/* Copyright 2002
Kei G. Gauthier
Suite 301
77 Winsor Street
Ludlow, MA 01056
class DocumentRenderer implements Printable {
/* DocumentRenderer prints objects of type Document. Text attributes, including
fonts, color, and small icons, will be rendered to a printed page.
DocumentRenderer computes line breaks, paginates, and performs other
formatting.
An HTMLDocument is printed by sending it as an argument to the
print(HTMLDocument) method. A PlainDocument is printed the same way. Other
types of documents must be sent in a JEditorPane as an argument to the
print(JEditorPane) method. Printing Documents in this way will automatically
display a print dialog.
As objects which implement the Printable Interface, instances of the
DocumentRenderer class can also be used as the argument in the setPrintable
method of the PrinterJob class. Instead of using the print() methods
detailed above, a programmer may gain access to the formatting capabilities
of this class without using its print dialog by creating an instance of
DocumentRenderer and setting the document to be printed with the
setDocument() or setJEditorPane(). The Document may then be printed by
setting the instance of DocumentRenderer in any PrinterJob.
protected int currentPage = -1; //Used to keep track of when
//the page to print changes.
protected JEditorPane jeditorPane; //Container to hold the
//Document. This object will
//be used to lay out the
//Document for printing.
protected double pageEndY = 0; //Location of the current page
//end.
protected double pageStartY = 0; //Location of the current page
//start.
protected boolean scaleWidthToFit = true; //boolean to allow control over
//whether pages too wide to fit
//on a page will be scaled.
/* The DocumentRenderer class uses pFormat and pJob in its methods. Note
that pFormat is not the variable name used by the print method of the
DocumentRenderer. Although it would always be expected to reference the
pFormat object, the print method gets its PageFormat as an argument.
protected PageFormat pFormat;
protected PrinterJob pJob;
/* The constructor initializes the pFormat and PJob variables.
public DocumentRenderer() {
pFormat = new PageFormat();
pJob = PrinterJob.getPrinterJob();
/* Method to get the current Document
public Document getDocument() {
if (jeditorPane != null) return jeditorPane.getDocument();
else return null;
/* Method to get the current choice the width scaling option.
public boolean getScaleWidthToFit() {
return scaleWidthToFit;
/* pageDialog() displays a page setup dialog.
public void pageDialog() {
pFormat = pJob.pageDialog(pFormat);
/* The print method implements the Printable interface. Although Printables
may be called to render a page more than once, each page is painted in
order. We may, therefore, keep track of changes in the page being rendered
by setting the currentPage variable to equal the pageIndex, and then
comparing these variables on subsequent calls to this method. When the two
variables match, it means that the page is being rendered for the second or
third time. When the currentPage differs from the pageIndex, a new page is
being requested.
The highlights of the process used print a page are as follows:
I. The Graphics object is cast to a Graphics2D object to allow for
scaling.
II. The JEditorPane is laid out using the width of a printable page.
This will handle line breaks. If the JEditorPane cannot be sized at
the width of the graphics clip, scaling will be allowed.
III. The root view of the JEditorPane is obtained. By examining this root
view and all of its children, printView will be able to determine
the location of each printable element of the document.
IV. If the scaleWidthToFit option is chosen, a scaling ratio is
determined, and the graphics2D object is scaled.
V. The Graphics2D object is clipped to the size of the printable page.
VI. currentPage is checked to see if this is a new page to render. If so,
pageStartY and pageEndY are reset.
VII. To match the coordinates of the printable clip of graphics2D and the
allocation rectangle which will be used to lay out the views,
graphics2D is translated to begin at the printable X and Y
coordinates of the graphics clip.
VIII. An allocation Rectangle is created to represent the layout of the
Views.
The Printable Interface always prints the area indexed by reference
to the Graphics object. For instance, with a standard 8.5 x 11 inch
page with 1 inch margins the rectangle X = 72, Y = 72, Width = 468,
and Height = 648, the area 72, 72, 468, 648 will be painted regardless
of which page is actually being printed.
To align the allocation Rectangle with the graphics2D object two
things are done. The first step is to translate the X and Y
coordinates of the graphics2D object to begin at the X and Y
coordinates of the printable clip, see step VII. Next, when printing
other than the first page, the allocation rectangle must start laying
out in coordinates represented by negative numbers. After page one,
the beginning of the allocation is started at minus the page end of
the prior page. This moves the part which has already been rendered to
before the printable clip of the graphics2D object.
X. The printView method is called to paint the page. Its return value
will indicate if a page has been rendered.
Although public, print should not ordinarily be called by programs other
than PrinterJob.
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) {
double scale = 1.0;
Graphics2D graphics2D;
View rootView;
// I
graphics2D = (Graphics2D) graphics;
disableDoubleBuffering(jeditorPane);
// II
jeditorPane.setSize((int) pageFormat.getImageableWidth(),Integer.MAX_VALUE);
jeditorPane.validate();
// III
rootView = jeditorPane.getUI().getRootView(jeditorPane);
// IV
if ((scaleWidthToFit) && (jeditorPane.getMinimumSize().getWidth() >
pageFormat.getImageableWidth())) {
scale = pageFormat.getImageableWidth()/
jeditorPane.getMinimumSize().getWidth();
graphics2D.scale(scale,scale);
// V
graphics2D.setClip((int) (pageFormat.getImageableX()/scale),
(int) (pageFormat.getImageableY()/scale),
(int) (pageFormat.getImageableWidth()/scale),
(int) (pageFormat.getImageableHeight()/scale));
// VI
if (pageIndex > currentPage) {
currentPage = pageIndex;
pageStartY += pageEndY;
pageEndY = graphics2D.getClipBounds().getHeight();
// VII
graphics2D.translate(graphics2D.getClipBounds().getX(),
graphics2D.getClipBounds().getY());
// VIII
Rectangle allocation = new Rectangle(0,
(int) -pageStartY,
(int) (jeditorPane.getMinimumSize().getWidth()),
(int) (jeditorPane.getPreferredSize().getHeight()));
// X
if (printView(graphics2D,allocation,rootView)) {
return Printable.PAGE_EXISTS;
else {
pageStartY = 0;
pageEndY = 0;
currentPage = -1;
return Printable.NO_SUCH_PAGE;
/** The speed and quality of printing suffers dramatically if
* any of the containers have double buffering turned on.
* So this turns if off globally.
* @see enableDoubleBuffering
public static void disableDoubleBuffering(Component c) {
RepaintManager currentManager = RepaintManager.currentManager(c);
currentManager.setDoubleBufferingEnabled(false);
/** Re-enables double buffering globally. */
public static void enableDoubleBuffering(Component c) {
RepaintManager currentManager = RepaintManager.currentManager(c);
currentManager.setDoubleBufferingEnabled(true);
/* print(HTMLDocument) is called to set an HTMLDocument for printing.
public void print(HTMLDocument htmlDocument) {
setDocument(htmlDocument);
printDialog();
/* print(JEditorPane) prints a Document contained within a JEDitorPane.
public void print(JEditorPane jedPane) {
setDocument(jedPane);
printDialog();
/* print(PlainDocument) is called to set a PlainDocument for printing.
public void print(PlainDocument plainDocument) {
setDocument(plainDocument);
printDialog();
/* A protected method, printDialog(), displays the print dialog and initiates
printing in response to user input.
protected void printDialog() {
if (pJob.printDialog()) {
pJob.setPrintable(this,pFormat);
try {
pJob.print();
catch (PrinterException printerException) {
pageStartY = 0;
pageEndY = 0;
currentPage = -1;
System.out.println("Error Printing Document");
/* printView is a recursive method which iterates through the tree structure
of the view sent to it. If the view sent to printView is a branch view,
that is one with children, the method calls itself on each of these
children. If the view is a leaf view, that is a view without children which
represents an actual piece of text to be painted, printView attempts to
render the view to the Graphics2D object.
I. When any view starts after the beginning of the current printable
page, this means that there are pages to print and the method sets
pageExists to true.
II. When a leaf view is taller than the printable area of a page, it
cannot, of course, be broken down to fit a single page. Such a View
will be printed whenever it intersects with the Graphics2D clip.
III. If a leaf view intersects the printable area of the graphics clip and
fits vertically within the printable area, it will be rendered.
IV. If a leaf view does not exceed the printable area of a page but does
not fit vertically within the Graphics2D clip of the current page, the
method records that this page should end at the start of the view.
This information is stored in pageEndY.
protected boolean printView(Graphics2D graphics2D, Shape allocation,
View view) {
boolean pageExists = false;
Rectangle clipRectangle = graphics2D.getClipBounds();
Shape childAllocation;
View childView;
if (view.getViewCount() > 0 &&
!view.getElement().getName().equalsIgnoreCase("td")) {
for (int i = 0; i < view.getViewCount(); i++) {
childAllocation = view.getChildAllocation(i,allocation);
if (childAllocation != null) {
childView = view.getView(i);
if (printView(graphics2D,childAllocation,childView)) {
pageExists = true;
} else {
// I
if (allocation.getBounds().getMaxY() >= clipRectangle.getY()) {
pageExists = true;
// II
if ((allocation.getBounds().getHeight() > clipRectangle.getHeight()) &&
(allocation.intersects(clipRectangle))) {
view.paint(graphics2D,allocation);
} else {
// III
if (allocation.getBounds().getY() >= clipRectangle.getY()) {
if (allocation.getBounds().getMaxY() <= clipRectangle.getMaxY()) {
view.paint(graphics2D,allocation);
} else {
// IV
if (allocation.getBounds().getY() < pageEndY) {
pageEndY = allocation.getBounds().getY();
return pageExists;
/* Method to set the content type the JEditorPane.
protected void setContentType(String type) {
jeditorPane.setContentType(type);
/* Method to set an HTMLDocument as the Document to print.
public void setDocument(HTMLDocument htmlDocument) {
jeditorPane = new JEditorPane();
setDocument("text/html",htmlDocument);
/* Method to set the Document to print as the one contained in a JEditorPane.
This method is useful when Java does not provide direct access to a
particular Document type, such as a Rich Text Format document. With this
method such a document can be sent to the DocumentRenderer class enclosed
in a JEditorPane.
public void setDocument(JEditorPane jedPane) {
jeditorPane = new JEditorPane();
setDocument(jedPane.getContentType(),jedPane.getDocument());
/* Method to set a PlainDocument as the Document to print.
public void setDocument(PlainDocument plainDocument) {
jeditorPane = new JEditorPane();
setDocument("text/plain",plainDocument);
/* Method to set the content type and document of the JEditorPane.
protected void setDocument(String type, Document document) {
setContentType(type);
jeditorPane.setDocument(document);
/* Method to set the current choice of the width scaling option.
public void setScaleWidthToFit(boolean scaleWidth) {
scaleWidthToFit = scaleWidth;
}The sample input file is "mark.html":::
<html>
<head>
<style type="text/css">
<!--
ol { list-style-type: decimal; margin-top: 10; margin-left: 50; margin-bottom: 10 }
u { text-decoration: underline }
s { text-decoration: line-through }
p { font-weight: normal; font-size: medium; margin-top: 15 }
dd p { margin-top: 0; margin-left: 40; margin-bottom: 0 }
ol li p { margin-top: 0; margin-bottom: 0 }
address { color: blue; font-style: italic }
i { font-style: italic }
h6 { font-weight: bold; font-size: xx-small; margin-top: 10; margin-bottom: 10 }
h5 { font-weight: bold; font-size: x-small; margin-top: 10; margin-bottom: 10 }
h4 { font-weight: bold; font-size: small; margin-top: 10; margin-bottom: 10 }
h3 { font-weight: bold; font-size: medium; margin-top: 10; margin-bottom: 10 }
dir li p { margin-top: 0; margin-bottom: 0 }
h2 { font-weight: bold; font-size: large; margin-top: 10; margin-bottom: 10 }
b { font-weight: bold }
h1 { font-weight: bold; font-size: x-large; margin-top: 10; margin-bottom: 10 }
a { color: blue; text-decoration: underline }
ul li ul li ul li { margin-right: 0; margin-top: 0; margin-left: 0; margin-bottom: 0 }
menu { margin-top: 10; margin-left: 40; margin-bottom: 10 }
menu li p { margin-top: 0; margin-bottom: 0 }
table table { border-color: Gray; margin-right: 0; border-style: outset; margin-top: 0; margin-left: 0; margin-bottom: 0 }
sup { vertical-align: sup }
body { margin-right: 0; font-size: 14pt; font-family: SansSerif; color: black; margin-left: 0 }
ul li ul li ul { list-style-type: square; margin-left: 25 }
blockquote { margin-right: 35; margin-top: 5; margin-left: 35; margin-bottom: 5 }
samp { font-size: small; font-family: Monospaced }
cite { font-style: italic }
sub { vertical-align: sub }
em { font-style: italic }
table table table { border-color: Gray; margin-right: 0; border-style: outset; margin-top: 0; margin-left: 0; margin-bottom: 0 }
ul li p { margin-top: 0; margin-bottom: 0 }
ul li ul li { margin-right: 0; margin-top: 0; margin-left: 0; margin-bottom: 0 }
var { font-weight: bold; font-style: italic }
table { border-color: Gray; margin-right: 7; border-style: outset; margin-top: 7; margin-left: 7; margin-bottom: 17 }
dfn { font-style: italic }
menu li { margin-right: 0; margin-top: 0; margin-left: 0; margin-bottom: 0 }
strong { font-weight: bold }
ul { list-style-type: disc; margin-top: 10; margin-left: 50; margin-bottom: 10 }
center { text-align: center }
ul li ul { list-style-type: circle; margin-left: 25 }
kbd { font-size: small; font-family: Monospaced }
dir li { margin-right: 0; margin-top: 0; margin-left: 0; margin-bottom: 0 }
th p { font-weight: bold; padding-left: 2; padding-bottom: 3; padding-right: 2; margin-top: 0; padding-top: 3 }
ul li menu { list-style-type: circle; margin-left: 25 }
dt { margin-top: 0; margin-bottom: 0 }
ol li { margin-right: 0; margin-top: 0; margin-left: 0; margin-bottom: 0 }
li p { margin-top: 0; margin-bottom: 0 }
strike { text-decoration: line-through }
dl { margin-top: 10; margin-left: 10; margin-bottom: 10 }
tt { font-family: Monospaced }
ul li { margin-right: 0; margin-top: 0; margin-left: 0; margin-bottom: 0 }
dir { margin-top: 10; margin-left: 40; margin-bottom: 10 }
pre p { margin-top: 0 }
th { border-color: Gray; border-style: solid; padding-left: 3; padding-bottom: 3; padding-right: 1; padding-top: 1 }
pre { font-family: Monospaced; margin-top: 5; margin-bottom: 5 }
td { border-color: Gray; border-style: inset; padding-left: 3; padding-bottom: 3; padding-right: 1; padding-top: 1 }
td p { padding-left: 2; padding-bottom: 3; padding-right: 2; margin-top: 0; padding-top: 3 }
code { font-size: small; font-family: Monospaced }
small { font-size: x-small }
big { font-size: x-large }
-->
</style>
</head>
<body>
<p style="margin-top: 0">
</p>
<table width="500" cellspacing="20" border="1">
<tr>
<td height="330" valign="top">
<table border="0">
<tr>
<td>
<font size="2">This is to certify that [[Client Name]], born
on [[Client Date of Birth]], of [[Client Residential
Address]], was the holder of motor vehicle driver
licence number [[Client Licence Number]], first issued on
[[First Issue Date of Holding]] and expired on [[Holding
Expiry Date]].<br></font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="500" border="2">
<tr>
<td>
<table width="480" border="0">
<tr>
<td align="right">
<font size="2"><br>
<b>Fred Flintstone<br>Manager</b><br>Records Services Division<br>State
Police<br>An authorised person for the purposes of the
Road Act 1986</font>
</td>
</tr>
<tr>
<td align="left">
<font size="2"><b>User ID: wzvqv7<br>Dated: 29 November 2006</b>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>I have finally cracked it!!!!!!!!!!!!!!!!
The issue is definitely with Java Sun. "Uneven character spacing when printing JTextComponent"
It is raised on the http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6488219
And currently in OPEN state, and raised on 31 Oct 2006 and mentions it was caused by fix 4352983.
So where do we go from here. It's not good because I have tried all later version of the JVM and the issue is still there.
Why? Because it hasn't been fixed yet. Read the bug report above, as it gives more insight -- and mentions the workaround is NOT good for existing code.
So the way forward is to use an earlier version of the JVM 5.
I download the JVM version 1.5.0 (starting version) and works Ok... I would probably think version prior to 4352983 would be Ok too.
Please vote for this.... We have a workaround (use older version of the JVM).
So I am very happy. -
Why can't I get this extension to show up after I download it, help with code?
Is there an error in the source code somwhere, here is the url https://addons.mozilla.org/en-US/firefox/addon/wisecampus-1/. I created this extension with the app builder where it generates a zip and you modify it to what you want. I made very little changes, I just would like to have a button on the toolbar that launches the site when clicked. If someone with more experience could take a look at the source code and possibly help me get this up and running it would be greatly appreciated. Thanks all!
Not really a Firefox user support issue. I am not am add-on developer, but I think I found your problem. ''Can't show the actual css code from that file, this forum software would try to execute it instead of displaying the code.''
In the '''overlay.css''' file the '''''wcextension-toolbar-button - list-style-image''''' shows the '''''url''''' as http://www.wisecampusbooks.com/images/WC_icon2.jpg . Shouldn't it point to the '''toolbar-button.png''' image in the \chrome\skin\ folder instead?
I can see the image from that URL when the toolbar button is sitting in the Customize Palette, but the image disappears when the button is moved to a Toolbar. I think that using a web based image in the UI is a security fault, which Firefox is blocking. Something like that could potentially be used to "track" a user or to count how often that button is clicked.
''BTW'' the Add-ons support forum is here: <br />
https://forums.mozilla.org/addons/ <br />
or you could post here, if you need additional help <br />
http://forums.mozillazine.org/viewforum.php?f=53&sid=554d097b5d69110d4859bd054051b9b2 -
Need help with code for adding dates to form
Hello forum goers
I'm new to making forms and figured out how to auto add the date, however I need the form to change the date for every copy made.
For example today is 06/08/2012 if I print 10 copies of the form it will output 10 pages ranging from 06/08/2012 to 06/17/2012. If code exists to do this I would be very gratefull to whoever helps, I also wouldn't mind if that is not possible for manually inputing the start / end dates.
Currently I print 15-30 copies of the form and hand write each of the dates but I'm just getting to busy to do that. I also cannot print one a day it must be in batches.
Thanks in advanced.What you are asking for is more complex than just setting the current date. Each time the form prints it has to know that it has to change the date. I would suggest doing this.
First, setup a document level script to set the date to the current date. I suspect that you have already done this?
Next, Create a "DidPrint" document action to increment the date. To do this the script will need to scan the current text value of the date, add one day to it, and then reformat it. You'll find information on this type of scripting in these articles:
http://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascr
ipt
http://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascr
ipt-part-2
http://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascr
ipt-part-3
Since the increment happenes in the Did Print you will need to print each copy individually. If you enter 10 copies in the print dialog it won't work. You have to print one at a time. You can automate this activity with a console script.
One of the advantages of incrementing in the DidPrint is that you can also manually enter a date and it will increment from there.
Thom Parker
The source for PDF Scripting Info
pdfscripting.com
The Acrobat JavaScript Reference, Use it Early and Often
Then most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)
Having trouble, Why Doesn't my Script Work? -
SSL - Default SSL context init failed: null - need help with code
Hi!
Once Again I have problems with SSL.
I read something about SSL here:
http://www.javaalmanac.com/egs/javax.net.ssl/Server.html
Now I tried to test this stuff, that resulted in this program (I simply tried to put the SSL stuff from the above code in a small skeleton):
import java.io.*;
import java.net.*;
import java.security.*;
import javax.net.ssl.*;
import javax.net.*;
public class MyServer
public static void main(String arguments[])
try
int port = 443;
ServerSocketFactory ssocketFactory = SSLServerSocketFactory.getDefault();
ServerSocket ssocket = ssocketFactory.createServerSocket(port);
// Listen for connections
Socket socket = ssocket.accept();
System.out.println("Connected successfully");
// Create streams to securely send and receive data to the client
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();
// Read from in and write to out...
// Close the socket
in.close();
out.close();
catch(IOException e)
System.out.println("GetMessage() = "+e.getMessage());
e.printStackTrace();
} Now I compiled this stuff with : 'javac MyServer.java' - there were no errors. After this I run the program
with the following command (also taken from java almanac):
'java -Djavax.net.ssl.keyStore=mySrvKeystore -Djavax.net.ssl.keyStorePassword=123456 MyServer'
But if I run it, it reports:
"GetMessage() = Default SSL context init failed: null
java.net.SocketException: Default SSL context init failed: null
at javax.net.ssl.DefaultSSLServerSocketFactory.createServerSocket(Dasho
6275)
at MyServer.main(MyServer.java:15)"
createServerSocket() seems to be the wrong line, but what is wrong with it.
Is there any mistake in my code ?
Btw. I created my keystore etc. according to the instructions at
http://forum.java.sun.com/thread.jsp?forum=2&thread=528092&tstart=0&trange=15
Any help appreciated
Greets
dancing_coderI got this error last week.
The problem was that the keystore I was pointing to, was in other location, so it could not initialize the default context.
I had defined ...
String CLIENT_CERTIFPATH = getParam("client.certificate.path", "/users/pridas/myKeystoreFile");
// getParam extracts the location of the keystore from a text file which contains some configuration parameters. The default value will be /users/pridas/myKeystoreFile
In my case, I will try to develop a secure SOAP conexion using certificates.
Before to try the conexion, I defined ...
System.setProperty("javax.net.ssl.trustStore", CLIENT_CERTIFPATH);
System.setProperty("javax.net.ssl.keyStore", CLIENT_CERTIFPATH);
... and the problem when I got this error ... the keystore file was not in the correct location.
That was how I resolved this error.
I hope everybody will be oriented about this kind of errors.
Salu2. -
Help with adding additional image in php
Php coding help needed
Hello
I need some help in changing 2 php files so that I can grab
the first image from an xml file.
At the moment ..the xml has an image category called
<UserLogo>img/IMG_1197.JPG</UserLogo>
I want to add this USERLOGO portion in the 2 php files ..but
do not know how to change the code. On the webpage in question,
because the USERLOGO is not incorporated in the php files ..a
default image currently shows up on the page:
At the moment there are USERLOGO1 2 3 4 AND 5 Coding in the
php files but I would like to add USERLOGO to the mix
I have coding for the 2 php files currently in use
xml_common.php and xml_functionsheadlines.php which are used to
grab the xml.
any help would be greatly appreciated ..thanks RobA RED curtain? Wow, they really didn't want to make this easy, did they. There is a lot to making a good difference matte, it's no easy task. My suggestion is, get a book on compositing, watch Lynda.com tutorials, do whatever you have to to learn how to do it right, and then charge a lot of money for it. My view on people hiring students to do this kind of work is that they figure they can get you while you're green and don't know what the job is worth. They can't afford a professional who charges accordingly.
Kudos to you for getting the gig, but don't let them get away with having you do a ton of work for peanuts, or even worse, for free. -
Borderless Window help with code please!
I am using Dreamweaver MX 2004.
I just cannot get my head round this Java code and would really appreciate some help or direction!
I want to make a nice little window to show a few lines of text, with a close button or X in the corner (not fussed). I have looked at lots of tutorials and produced numerous codes to use.
OK, fine I get that bit. My problem comes with placing the codes in the right places. I paste the HEAD portion in the head of the doc. The BODY in the body. BUT is this the doc I am going to call up with my few lines of text in, or the doc I am going to call from? Get what I mean? Also I want to call from a link and haven't had much luck with the line of code I put in the link box. I have tried lots ways and have just managed to confuse myself.
I am not asking for someone to do it for me and believe me I have tried to work this out for myself but it's not happening for me. Please can someone explain this to me in very plain English as I am obviously some sort of delinquent!
Thank youYes I am using HTML and Javascript. So Java and Javascript are not the same thing? Right ,OK ,well that has taught me something. Don't suppose you can help me with script on this forum then. Sorry!
Maybe you are looking for
-
Routine for getting past monday
Hi, I need to write a start routine in transformations of a cube for this requiremnt : ZSTARTDATE > = the past monday Note: If possible, we should use an input variable to determine the date of past Monday. It should default to the past Monday base o
-
How to develope a KM filter with EP 7.31
Dear all, I have following questions regarding KM filters on an EP 7.31: 1.)Where the NWDS assistant for this purpose is gone on 7.31? Compare to NWDS 7.0: 2.)Are there any changes in the structure changes in the package between 7 and 7.31? Is this d
-
Connect IBOOK g3 to netgear model wpn824v2
I just inherited an Ibook G3. I have a netgear Model WPN824v2 wireless router. I am not able to get an internet connection wirelessly. The ibook shows my wireless network name, but when I enter my password, the ibook says it isn't a good password. I
-
I plugged in my phone to my macbook to transfer images. I pulled ou the usb cord without ejecting it properly and all the pictures from my phone got deleted and didint get transfered. Is there any way I can recover my photos They are really important
-
can we copy back songs from iPhone to iTunes library, once if deleted from iTunes library ?