Web dnypro Application performance
I am interested in comparison of performance of 2 web dynpro applications .
I have already gone through the following blog :
/people/bertram.ganz/blog/2006/11/21/analyzing-web-dynpro-java-application-performance-with-a-simple-url-parameter
Is there any method or tool other than this by which i can compare the performance of two web Dyn applications in terms of response time or some graphical interpretaions .
Hi Purav,
Please go through this Link,
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/bb/fdc4402418742ae10000000a155106/frameset.htm">Measuring Performance of Webdynpro Allpications</a>
Regards,
Ramganesan K.
Similar Messages
-
Browser for Web Dnypro Java Applications?
Hi All,
is there any documentation which is recommending a browser for Web Dynpro Java Applications?
Is there any other Information about browser compatibility of Web Dnypro Applications available?
Best, JohannesCheck the Product Availability Matrix (PAM) at [http://service.sap.com/pam|http://service.sap.com/pam].
For SAP NetWeaver PI 7.1, these are the requirements (in short):
IE 6 or 7 on Windows XP SP2
Firefox 2.0 on Windows XP SP2, Linux or Mac OS X
I really hope they will add support for Safari/Google Chrome in the future.
-martin -
when i push the button to send a mail in my Web dnypro application
there is an warning occured like this:
Sending failed; nested exception is: javax.mail.MessagingException: 454 5.7.3 Client does not have permission to submit mail to this server.
what's the matter?(is that interrelated with the sending mail host)Make sure you maintain java mail client settings in Visual Admin
use the following code example to send mail messages
Properties props = new Properties();
props.put("domain", "true");
Context initialContext = new InitialContext(props);
Session sess = (Session) initialContext.lookup("java:comp/env/mail/MailSession");
Session mailSession = Session.getDefaultInstance(sess.getProperties());
Transport transport = mailSession.getTransport("smtp");
//MimeMessage message = new MimeMessage(sess);
MimeMessage message = new MimeMessage(mailSession);
message.setSubject("Your ERP Portal Certificate");
message.setFrom(new InternetAddress("[email protected]"));
message.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(userArr.getEmail()));
// This HTML mail have to 2 part, the BODY and the embedded image
MimeMultipart multipart = new MimeMultipart("related");
// first part (the html)
BodyPart messageBodyPart = new MimeBodyPart();
String htmlText ="Dear ERP user , </b>" ; messageBodyPart.setContent(htmlText, "text/html");
// add it
multipart.addBodyPart(messageBodyPart);
// put everything together
message.setContent(multipart);
transport.connect();
transport.sendMessage(message, message.getRecipients(javax.mail.Message.RecipientType.TO));
transport.close();
proxy.gotoPage("umHelpPage");
uidUserCreatteLog(userArr.getEmail());
chk it also
Re: Sending Email from Web Dynpro -
Integrate Web Dynpro Application into a Guided Procedure Step
hi guys
I would like to integrate my Web Dynpro Application into a GP-Step.
I DON't want a:
- Web Dynpro Component (GP Interface)
- Composite Application Web Dynpro Component
I think I have to use "Web Dnypro Application" from the callable objects list.
However, I couldn't see any input parameters.
Thanks for your help.
Regards,
Go:khanHi Gökhan,
in my mind you only see Input/ Output Parameters within a Web Dynpro Application when you use the GP Interface.
WHen you want to have some for parameter mapping, you must implement an Web Dynpro Application with GP connectors.
Take the following tutorial to do that.
Hope it helps
Bye Steve -
Poor performance of web dynpro application
Hi,
I have developed web dynpro application which fetches data from R3 system using JCO connection.Large amount of data is transferred between R3 and application,because of which it is taking too long for displaying result.
After displaying timestamp before and after RFC execution code I came to know that, it is taking approx. 5 min for RFC execution, resulting in poor performance.Time taken for rest of processing is negligible.Is there any way by which I can reduce time for RFC execution or data transfer?
Thanks in advance,
ApurvaHI Apurva,
I think u r displaying the whole data at a stretch in the front end. So it will take some time for rendring. So try to reduce the display elements (For example, for tables, display only 10 rows at a time).
regards
Fahad Hamsa -
Error - Creating a Web Dynpro Application Accessing ABAP Functions
Dear All,
we are trying to implement a web dynpro application with accessing ABAP functions.
Previous tasks:
- insert the ABAP system into the SLD from the NWDI System (Transaction RZ70; the ABAP system is correctly insert into the SLD => technical systems)
- equipped the JCO connections with the web dynpro content manager (ping and test = OK)
Its the standard tutorial out of the SDN called Creating a Web Dynpro Application Accessing ABAP Functions.
Some hints:
- There are no errors after the implementation and the rebuild of the project in the NWDS
- The auto deployment works fine to the development runtime system. The application is shown in the Web Dynpro content manager
- The In the build log I found these entries:
System.err] [Invoked from com.sap.s2x.tools.GUID.getnodeaddress(GUID.java:585)]
[System.err] java.net.UnknownHostException: FRASAPP562: FRASAPP562
[System.err] at java.net.InetAddress.getLocalHost(InetAddress.java:1191)
[System.err] at com.sap.s2x.tools.GUID.getnodeaddress(GUID.java:575)
[System.err] at com.sap.s2x.tools.GUID.<clinit>(GUID.java:179)
[System.err] at com.sap.s2x.tools.S2XGUID.getGUID(S2XGUID.java:19)
[System.err] at com.sap.ide.metamodel.core.i18n.LanguageState.createS2XID(LanguageState.java:191)
[System.err] at com.sap.ide.metamodel.core.i18n.S2XLanguageUnmarshaller.unmarshal(S2XLanguageUnmarshaller.java:52)
[System.err] at com.sap.ide.metamodel.core.i18n.TextPoolProxy.loadLanguageState(TextPoolProxy.java:703)
[System.err] at com.sap.ide.metamodel.core.i18n.TextPoolProxy.prepareLanguageForRead(TextPoolProxy.java:646)
[System.err] at com.sap.ide.metamodel.core.i18n.TextPoolProxy.isEmpty(TextPoolProxy.java:222)
[System.err] at com.sap.ide.webdynpro.checklayer.MDOChecker.check(MDOChecker.java:23)
[System.err] at com.sap.ide.webdynpro.checklayer.view.ViewChecker.check(ViewChecker.java:52)
[System.err] at com.sap.ide.webdynpro.checklayer.controller.ViewControllerChecker.check(ViewControllerChecker.java:96)
[System.err] at com.sap.ide.webdynpro.checklayer.controller.ControllerChecker.check(ControllerChecker.java:119)
[System.err] at com.sap.ide.webdynpro.checklayer.controller.ControllerChecker.check(ControllerChecker.java:56)
[System.err] at com.sap.ide.webdynpro.checklayer.component.ComponentChecker.check(ComponentChecker.java:181)
[System.err] at com.sap.ide.webdynpro.checklayer.component.ComponentChecker.check(ComponentChecker.java:56)
[System.err] at com.sap.ide.webdynpro.generation.Generation.check(Generation.java:2039)
[System.err] at com.sap.ide.webdynpro.generation.Generation.generatePersistentComponent(Generation.java:1296)
[System.err] at com.sap.ide.webdynpro.generation.console.GenerationConsole.generate(GenerationConsole.java:175)
[System.err] at com.sap.webdynpro.generation.ant.GenerationAnt.main(GenerationAnt.java:50)
[System.err] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[System.err] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[System.err] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[System.err] at java.lang.reflect.Method.invoke(Method.java:324)
[System.err] at com.sap.webdynpro.generation.ant.WDGenAntTask.execute(WDGenAntTask.java:219)
[System.err] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[System.err] at org.apache.tools.ant.Task.perform(Task.java:364)
[System.err] at org.apache.tools.ant.Target.execute(Target.java:341)
[System.err] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[System.err] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[System.err] at com.sap.tc.buildplugin.techdev.ant.util.AntRunner.run(AntRunner.java:112)
[System.err] at com.sap.tc.buildplugin.DefaultAntBuildAction.execute(DefaultAntBuildAction.java:61)
[System.err] at com.sap.tc.buildplugin.DefaultPlugin.handleBuildStepSequence(DefaultPlugin.java:213)
[System.err] at com.sap.tc.buildplugin.DefaultPlugin.performBuild(DefaultPlugin.java:190)
[System.err] at com.sap.tc.buildplugin.DefaultPluginV3Delegate$BuildRequestHandler.handle(DefaultPluginV3Delegate.java:66)
[System.err] at com.sap.tc.buildplugin.DefaultPluginV3Delegate.requestV3(DefaultPluginV3Delegate.java:48)
[System.err] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[System.err] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[System.err] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[System.err] at java.lang.reflect.Method.invoke(Method.java:324)
[System.err] at com.sap.tc.buildtool.v2.impl.PluginHandler2.maybeInvoke(PluginHandler2.java:350)
[System.err] at com.sap.tc.buildtool.v2.impl.PluginHandler2.request(PluginHandler2.java:102)
[System.err] at com.sap.tc.buildtool.v2.impl.PluginHandler2.build(PluginHandler2.java:76)
[System.err] at com.sap.tc.buildtool.PluginHandler2Wrapper.execute(PluginHandler2Wrapper.java:58)
[System.err] at com.sap.tc.devconf.impl.DCProxy.make(DCProxy.java:1723)
[System.err] at com.sap.tc.devconf.impl.DCProxy.make(DCProxy.java:1495)
[System.err] at com.sap.tc.buildcontroller.CBSBuildController.build(CBSBuildController.java:727)
[System.err] at com.sap.tc.buildcontroller.CBSBuildController.execCommand(CBSBuildController.java:503)
[System.err] at com.sap.tc.buildcontroller.CBSBuildController.evalCmdLine(CBSBuildController.java:442)
[System.err] at com.sap.tc.buildcontroller.CBSBuildController.run(CBSBuildController.java:314)
[System.err] at com.sap.tc.buildcontroller.CBSBuildController.exec(CBSBuildController.java:252)
[System.err] at com.sap.tc.buildcontroller.CBSBuildController.mainLoop(CBSBuildController.java:207)
- Im able to start the application out of the Web Dynpro content manager with run => only the user interface is displayed without any functionality
- The normal start over the NWDS fails => error text
com.sap.tc.webdynpro.services.sal.core.DispatcherException: The requested deployable object 'local/J08_Flugdat_Daventdcflight~xxx.com' and application 'FlightListApp' are not deployed on the server. Please check the used URL for typos.
There two different URLs in use.
Start via NWDS:
http://frasapp562:50000/webdynpro/dispatcher/J08_Flugdat_Daventdcflight~xxx.com/FlightListApp
Start via web dynpro content manager:
http://frasapp562:50000/webdynpro/dispatcher/xxx.com/aventdc~flight/FlightListApp
For test purposes, we started the BAPI (BAPI_Flight_Getlist) on the ABAP system directly. It works.
Any ideas about the system behaviours (different URLs and missing functionality)?
Thanks a lot in advanced!
Best regards
ChristophThe Error has been solved The implementation of a method was missing....
Thx
Christoph -
Error while accesing ABAP web dynpro application
Hi Experts,
We are getting warning symbol on web page status bar, when we are accessing the ABAP web dynpro application
only first page of application is getting loaded and when we click on page it is showing error on status bar and we can perform any thing.
once we double click on warning icon,
below details are coming:
Line: 1491
Char: 3
Error: Object Expected
Code: 0
URL: url of the ABAP web dynpro application
This scenario is occuring for many ABAP WD application for a client.
Please guide how to solve this issue?
Thanks!
PiyushHi
First try a very simple application with nothing in it just one text saying Hello World
Run it and see what happens.
Also check if your url uses FQDN name. something like https:
company.name.co:50000\.......
If you do not use the FQDN it will always show a script error on the bottom and some functions will not work e.g
dropdowns.
regards
Yuval. -
Web Based Application Single Sign on With Enterprise Portal
Good day Developers,
My question is really a two part question so forgive me in advance for asking in one post as I think they are relative to each other. My project is currently exlporing the creation of functionality that will allow the following:
1. We want to allow a secure Web Based application possessing the abilitiy to auithenticate the user into Enterprise Portal and by passing the login screen to get to a landing page/iview in our Enterprise Portal instannce.
2. We want the abilitity to perform a check of the user and create the user in the enterprise portal on the fly if they do not already exist.
So far in my research I've come across tools and white papers mentioning the use rof oAuth and OpenID. Is that the right way to tackle these two items. Thanks for your help in advance.
JDHi
1. You can do SSO between you application and portal using Verisign or third party authentication tool. I am not pretty sure how landing page and all will work as you mentioned.
As portal is web based, you can deply your application in portal server. So that you will not need any other authentication tool.Also you can save effort , cost.
2. By deploying application in portal also you do not have to concentrate on User management, which is itself a huge effort you have to put. Else you can go for third party tools like Identity management or ADS.
-Yogesh -
The Web Dynpro Application 'XssMenu' has expired
Hi,
we implement an ESS Scenario, with One Enterprise Portal 6.0 SP17, a mySAP ECC 5.0 System with ERP2004 and a seperate server with a java stack, because our customer don´t want to install and use a java stack on their HR/ERP systems. They want to minimize the performance.
After some configurations, we get the startpage for ESS. If I click on a service like travel management it has no effect. If I click the second time, I got an error "500 Internal Server Error" with the message
The Web Dynpro Application 'XssMenu' has expired. Please restart the application either with the refresh button or click the following link XssMenu.
Same error comes, if I choose travel management in the second navigation level and click the service. And same message on every service.
Now I tried anotehr way. I call the ess startpage directly on the external java stack. And here´s no problem. All WebDynpro-Services works fine.
Can anyone help me, why the WebDynpro Service doesn´t work in the Portal?
Best regards
ChristianWe had exactly the same problem. We had multiple java servers and our switch was not retaining stickiness. So it would send the user to a different java server which hadn't got any session data for that user.
If this could be it, get something like httplook to do a trace of what is happening. We saw it switching java servers.
If you do not have multiple servers it could be switches chopping out cookies, causing the same issue.
Paul -
The Web Dynpro application was called up with the wrong URL parameters
Hi all,
I am using the systems below:
ERP STACK :16
EHP : 4
EHP SP Stack :4
EA-HR * : 604(SP12)
SAP-HR * :604(SP12)
XSS JAVA components : SAP ESS 603 SP05
SAP MSS 600 SP16
PCUI_GP 603 SP05
Business Package : BP ERP05 ESS 1.41 SP04
BP ERP05 MSS 1.41 SP04
BP ERP05 COMMON PARTS 1.41 SP04
I am getting below error after clicking on the appraisal document:
App. Called Up Incorrectly
The Web Dynpro application was called up with the wrong URL parameters.
Note
Enter the URL parameters and their use.
You can find more information on the functions that you can perform in the catalog for appraisal templates in the Implementation Guide (IMG) for Objective Setting and Appraisals under Edit Forms.
I already applied the below notes also:
1468466 Performance Management Launchpad Configuration
1463821 Performance Management Portal Configuration
1416756 OBN Configuration in Performance Management
1408243 Configuration for object-based navigation
Plz advise me??
Thanks,
Anumitcan you paste the exact error. also you can take a HTTP trace and see which resourse or UWL is being launched!
-
Web Dynpro application does not apply portal theme
Hi Guys,
We created a new portal theme and assigned it to our users. The portal desktop gets assigned succesfully and portal applications also show the new theme colors. But all web dynpro pages still show in the blue SAP theme. This issue only occurs on our development portal, when we import the same theme on our test portal is all works fine.
I also tried to assign the WebDynpro parameters "sap.useWebDynproStyleSheet" and "sap.theme.default" and then the web dynpro applications are indeed forced into the portal theme. However, that is no soluition since all web dynpro applications then use the theme including SAP applications like the NetWeaver Administrator.
We looked at OSS note '1446099 - Web Dynpro application not displayed
in customer theme' but the stylesheets are not different.
sap portal sytlesheet: UR=7.31.0.14.1
Web Dynpro Style sheet: UR Version=7.31.0.14.0
The portals in which the theme does work have the same stylesheet versions as mentioned above.
We also created an OSS message for this so if we solve it that way I will update this message. But if there is anyone on this forum that might have an idea that it would be highly appreciated. If the problem takes too long to solve we will perform a refresh from a portal that works but I hope that we will be able to find the reason of this behavior.
Kind Regards,
Nico van der Linden...In theory, these versions should work correctly.
You can compare the patch levels applied on your dev portal and test portal - specifically compare the version/patch for the component EPPSERV*.SCA - and see if you have any differences there.
Thanks,
Shanti -
Can't paste text in a Web-started application
I am facing a problem with a limited (but growing) number of users: they are
unable to paste a block of text into a text field. Apparently the problem
occurs in Windows 7 only that seems to isolate the Web-start application into
a sandbox. What is strange is that the application is signed and requires
full access to resources. Since I am not a windows 7 user I can't reproduce
the problem, also with other Windows 7 users things work fine, what's curious.
I can't determine if the program would also be trapped in other I/O operation
cause registration (for which paste is needed) is first step and user can't
proceed any more.
Did anybody else have incur in the same problem. Do anybody know what user
shall do to unlock the paste operation?
I am sure there is some solution otherwise any RIA application deployed with
Java Web Start would be excluded by all future (Windows 7) market, but I don't
know what to tell my user to proceed.
Thanks very much to whoever can help.Andrew,
I think I spotted the problem, but unhappily got no confirmation from user (despite my kind request to perform a new test with modified code). The issue is probably not related Windows 7 but to the kind of mail program is used to "cut" the text. Some mail program encode it as plain text, others as rich text and still others (like Firebird I use) as html. I perceived this using your code and I was surprised (I was expecting text/plain). This explains why only certain users report the problem.
What is strange is that Java, under JNLP is unable to convert text/xxxx to text/plain when pasting in a text component, as it does if desktop-started. I am already sure it is text/xxxx because in a previous situation I asked user to perform a paste into a notepad and it worked fine, it doesn't paste only into a JText component. Probably when Java is not webstart-launched it uses native conversion and when web-started it considers MIME type. If not plain text returns an empty string.
I basically used your code, but considered only first MIME type and, if not text, I reject paste and ask user to go though a plain text editor. In my case it does not make sense trying to manage HTML or RTF: that would be an overkill.
Let's wait and see next case, anyway the inability to paste text/xxxx into text components this is a considerable limitation of web-started programs.
The good news I discovered during tests is that (apart new logo), deployment has really improved, at least timestamp is correctly handled. Until few months ago I had to start the application 2-3 times to have jnlp perceived that some jar were updated. -
Problem deploying Web Dynpro Application Definition
Hi,
I have written a Web Dynpro and then deployed it to an EP6 NW04 server without first defining the Web Dynpro Application (silly me, I know - how could I do such a thing?). Anyway, afterwards, I created the Web Dynpro Application definition, but no matter how many times I redeploy, it does not add it to the Web Dynpro now sitting on the server.
Können Sie mir bitte helfen?
MartinHi
Martin,
Although server is being maintained by third part(one option is though visual admin since you can't access it) other option is use youe web browser with url http://your server IP address:50000/index.html u will find webdynpro link as mentioned below
<b><u>Web Dynpro</u></b>
Web Dynpro is a User Interface technology available within the SAP NetWeaver Developer Studio.
Various Web Dynpro tools provide administrators and application developers with performance measurement and application administration capabilities. The Web Dynpro runtime is already deployed.
Now Click on <b><u>Web Dynpro </u></b> link
you will find Content administrato and web Dynpro administrator u will b directed to login page after entering with UID and passwd u can see all deployed applications ( u can check ur application) and details...
I hope this may help u..
RK -
Seeking advice with concept / design of a Java Web Services Application
Hi all,
After a week of searching the internet I'm not sure how which projects, services, etc. I should use to develop my application. Please could someone offer some advice?
Application outline (Java application running on Linux):
1. Wait for an instruction from a Windows WCF application. Instruction contains a list of domain names and one or two other parameters.
2. Perform queries upon those domain names (find if they are registered, etc. - takes 10-20 mins to do complete list)
3. Send back results to WCF application.
Solution 1 (first idea):
1. Create SOAP web service using Java Web Services / Apache to listen for requests. Executes a Java Client Application upon request.
2. Java Client Application performs the queries...
3. Java Client Application sends results to the Windows web service.
Solution 1 Problems:
a) Using 2 applications, they won't be able to share the same memory.
b) The whole process will be slow (having to pass the domain names from the service to application and execute the application each time) - A quick response is critical.
c) Would like is for the whole process to be done under one application, sharing the same memory.
Solution 2:
1. Create a Java Daemon from scratch listening for an incoming SOAP message (no web service like Apache/Tomcat involved).
2. Query the domain names in a new thread inside the Java Daemon
3. Send the results back via SOAP.
Solution 2 Problems:
Cannot find examples of how to create a SOAP service from scratch. E.g. creating a WSDL file based on my application; converting application methods to SOAP-callable methods easily (without writing a framework).
With all the Java tools and projects out there - Java EE, Glassfish Project - there must be a very easy way to achieve this seemingly simple task. Please can someone offer some advice?
Many thanks for reading this.
Richard
Edited by: jazzinbrazil on Mar 30, 2009 4:58 AMYou just need an app server like Tomcat.If I'm not wrong, Tomcat is a Servlet container.
Servlets aren't deactivated when they don't receive
any request for some time?
How can I deploy an application to Tomcat in order to
keep it always active?I don't know what you mean. Tomcat is an application that is always running. In what way are the Servlets deactivated?
Apache Axis: http://ws.apache.org/axis/
Yes I'm collecting some info about this... let's see
it!
Finally, to be more clearer... I don't want to start
a new application at each invocation (something like
getting the request, instantiating the necessary
classes and executing them) but to call an already
running app at each invocation (so, getting request
and invoking, in a manner that I don't know, the
running application).The container manages this. If you have data that must remain loaded, you can associate it with the class (use a static modifier.) This will complicate threading, however.
I can use Axis to get the request, but it also grants
me that my app will always be active?I think you are just using the wrong terminology here. What I think you are asking is whether the resources will be loded into memory at all times. If you want to ensure this behavior, you need to associate the data with a class. I'm not 100% positive, but I don't think Tomcat will unload classes in normal circumstances. -
Very slow GUI in web browser application
Hello,
I am trying to write a web browser application and I have a problem with the GUI. When the page is being loaded and set on the JEditorPane the GUI becomes very slow (actually it freezes). I don't know if this happens because of my swing implementation or because I am not using threads properly.
I use the SwingWorker class. I created a worker thread which loads the web page and then sets it to the JEditorPane.
Could you give me some ideas please? Below are some parts of my code.
Thank you
public class BrowserFrame extends javax.swing.JFrame {
/** Creates new form BrowserFrame */
public BrowserFrame() {
initComponents();
loadUrlsFromHistoryFile();
private class RetrievePageTask extends SwingWorker<Void, URL> {
private String address = null;
RetrievePageTask(String address) {
this.address = address;
pageLoadProgressBar.setIndeterminate(true);
protected Void doInBackground() {
URL url = null;
try {
url = new URL(address);
publish(url);
catch(MalformedURLException exc) {
System.out.println(exc);
catch(IOException exc) {
System.out.println(exc);
return null;
protected void process(List<URL> url) {
try {
pageEditorPane.setPage(url.get(url.size() - 1));
catch(IOException exc) {
System.out.println(exc);
String url_str = url.get(url.size() - 1).toString();
addressComboBox.setSelectedItem(url_str);
addUrlToAddressComboBox(url_str);
private void addressComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {
// Get the affected item
Object item = evt.getItem();
if(evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
// Item was just selected
if(item.toString().equalsIgnoreCase(""))
return;
RetrievePageTask retrievePageTask = new RetrievePageTask(item.toString());
retrievePageTask.execute();
else if(evt.getStateChange() == java.awt.event.ItemEvent.DESELECTED) {
// Item is no longer selected
System.out.println("\nItem: " + item + " is no longer selected");
private void addressComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
if ("comboBoxEdited".equals(evt.getActionCommand())) {
// User has typed in a string; only possible with an editable combobox
goButtonActionPerformed(evt);
else if ("comboBoxChanged".equals(evt.getActionCommand())) {
// User has selected an item; it may be the same item
System.out.println("\nSpot TWO");
private void goButtonActionPerformed(java.awt.event.ActionEvent evt) {
RetrievePageTask retrievePageTask = new RetrievePageTask(address);
retrievePageTask.execute();
private void pageEditorPaneHyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
if(evt.getEventType() == javax.swing.event.HyperlinkEvent.EventType.ACTIVATED) {
RetrievePageTask retrievePageTask = new RetrievePageTask(evt.getURL().toString());
retrievePageTask.execute();
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
BrowserFrame surfRider = new BrowserFrame();
surfRider.setVisible(true);
}Now it is all.
package webbrowser;
import java.net.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
public class BrowserFrame extends javax.swing.JFrame {
/** Creates new form BrowserFrame */
public BrowserFrame() {
initComponents();
loadUrlsFromHistoryFile();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
addressLabel = new javax.swing.JLabel();
goButton = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
pageEditorPane = new javax.swing.JEditorPane();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
homeButton = new javax.swing.JButton();
refreshButton = new javax.swing.JButton();
addressComboBox = new javax.swing.JComboBox();
jLabel1 = new javax.swing.JLabel();
statusLabel = new javax.swing.JLabel();
pageLoadProgressBar = new javax.swing.JProgressBar();
menuBar = new javax.swing.JMenuBar();
fileMenu = new javax.swing.JMenu();
openFileMenuItem = new javax.swing.JMenuItem();
exitMenuItem = new javax.swing.JMenuItem();
viewMenu = new javax.swing.JMenu();
historyMenuItem = new javax.swing.JMenuItem();
pageSourceMenuItem = new javax.swing.JMenuItem();
toolsMenu = new javax.swing.JMenu();
preferencesMenuItem = new javax.swing.JMenuItem();
helpMenu = new javax.swing.JMenu();
aboutMenuItem = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Surf Rider");
setName("browserFrame");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
addressLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
addressLabel.setText("Address:");
goButton.setText("GO");
goButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
goButtonActionPerformed(evt);
pageEditorPane.setEditable(false);
pageEditorPane.setContentType("text/html");
pageEditorPane.addHyperlinkListener(new javax.swing.event.HyperlinkListener() {
public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
pageEditorPaneHyperlinkUpdate(evt);
jScrollPane1.setViewportView(pageEditorPane);
jButton1.setText("Back");
jButton1.setEnabled(false);
jButton2.setText("Forth");
jButton2.setEnabled(false);
jButton3.setText("Stop");
jButton3.setEnabled(false);
homeButton.setText("Home");
homeButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
homeButtonActionPerformed(evt);
refreshButton.setText("Refresh");
refreshButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
refreshButtonActionPerformed(evt);
addressComboBox.setEditable(true);
addressComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
addressComboBoxItemStateChanged(evt);
addressComboBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addressComboBoxActionPerformed(evt);
jLabel1.setText("Browser status: ");
statusLabel.setText("Current status");
pageLoadProgressBar.setBorder(javax.swing.BorderFactory.createEtchedBorder());
fileMenu.setText("File");
fileMenu.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fileMenuActionPerformed(evt);
openFileMenuItem.setLabel("Open File...");
openFileMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
openFileMenuItemActionPerformed(evt);
fileMenu.add(openFileMenuItem);
exitMenuItem.setLabel("Exit");
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
viewMenu.setText("View");
viewMenu.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
viewMenuActionPerformed(evt);
historyMenuItem.setLabel("History");
viewMenu.add(historyMenuItem);
pageSourceMenuItem.setLabel("Page Source");
viewMenu.add(pageSourceMenuItem);
menuBar.add(viewMenu);
toolsMenu.setText("Tools");
preferencesMenuItem.setLabel("Preferences");
toolsMenu.add(preferencesMenuItem);
menuBar.add(toolsMenu);
helpMenu.setText("Help");
aboutMenuItem.setLabel("About");
helpMenu.add(aboutMenuItem);
menuBar.add(helpMenu);
setJMenuBar(menuBar);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.add(jButton1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton2)
.add(6, 6, 6)
.add(refreshButton)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton3)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(homeButton)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(addressLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 56, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(addressComboBox, 0, 568, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(goButton))
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1008, Short.MAX_VALUE)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(statusLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 339, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 470, Short.MAX_VALUE)
.add(pageLoadProgressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(goButton)
.add(jButton1)
.add(jButton2)
.add(homeButton)
.add(jButton3)
.add(refreshButton)
.add(addressLabel)
.add(addressComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 601, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel1)
.add(statusLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(pageLoadProgressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-1016)/2, (screenSize.height-724)/2, 1016, 724);
}// </editor-fold>
private class RetrievePageTask extends SwingWorker<Void, URL> {
private String address = null;
RetrievePageTask(String address) {
this.address = address;
pageLoadProgressBar.setIndeterminate(true);
public String getAddress() {
return address;
public void setAddress(String newAddress) {
address = newAddress;
protected Void doInBackground() {
URL url = null;
try {
url = new URL(address);
publish(url);
catch(MalformedURLException exc) {
System.out.println(exc);
catch(IOException exc) {
System.out.println(exc);
return null;
protected void process(List<URL> url) {
try {
System.out.println("\nBefore setting the editorPane");
pageEditorPane.setPage(url.get(url.size() - 1));
catch(IOException exc) {
System.out.println(exc);
String url_str = url.get(url.size() - 1).toString();
url_str = url_str.toLowerCase(); // URL string is turned in lower case
addressComboBox.setSelectedItem(url_str);
addUrlToAddressComboBox(url_str);
pageLoadProgressBar.setIndeterminate(false);
private void openFileMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
private void viewMenuActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
private void fileMenuActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Action performed when homeButton's Action Listener listens to an event. This
// event is passed here as a parameter (evt). The selected item of the addressComboBox is
// set to be the homePage. The browser goes to the home page.
private void homeButtonActionPerformed(java.awt.event.ActionEvent evt) {
addressComboBox.setSelectedItem(homePage);
// This method loads the URL history from the history.txt file into the vector and into the
// addressComboBox.
private void loadUrlsFromHistoryFile() {
BufferedReader inputStream = null;
addressComboBox.setSelectedItem(homePage);
try {
inputStream = new BufferedReader(new FileReader("history.txt"));
String tmp;
while((tmp = inputStream.readLine()) != null) {
// Adding url to history_mem vector
historyMem.add(tmp);
// Adding url to addressComboBox
addressComboBox.addItem(tmp);
catch(IOException exc) {
System.out.println(exc);
private void addressComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {
// Get the affected item
Object item = evt.getItem();
if(evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
// Item was just selected
System.out.println("\nItem: " + item + " was just selected");
if(item.toString().equalsIgnoreCase(""))
return;
RetrievePageTask retrievePageTask = new RetrievePageTask(item.toString());
retrievePageTask.execute();
else if(evt.getStateChange() == java.awt.event.ItemEvent.DESELECTED) {
// Item is no longer selected
System.out.println("\nItem: " + item + " is no longer selected");
// Action performed when an event occurs in the addressComboBox (eg Pressing enter
// after typing the address).
private void addressComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
if ("comboBoxEdited".equals(evt.getActionCommand())) {
// User has typed in a string; only possible with an editable combobox
goButtonActionPerformed(evt);
else if ("comboBoxChanged".equals(evt.getActionCommand())) {
// User has selected an item; it may be the same item
// Action performed when goButton's Action Listener listens to an event. This
// event is passed here as a parameter (evt). When a valid URL is inserted, the
// pageEditorPane is set to that URL.
private void goButtonActionPerformed(java.awt.event.ActionEvent evt) {
// 6 spaces added to the address. This is done for control reasons. Below we
// use substring which causes exception when those spaces do not exist.
String address = addressComboBox.getSelectedItem() + " ";
if(addressComboBox.getSelectedItem() == null || address.equalsIgnoreCase(" ") || address.equalsIgnoreCase("http:// ")) {
JOptionPane.showMessageDialog(null, "No address specified.", "No address", javax.swing.JOptionPane.ERROR_MESSAGE);
else {
if(!address.substring(0, 7).equalsIgnoreCase("http://"))
address = "http://" + address;
RetrievePageTask retrievePageTask = new RetrievePageTask(address);
retrievePageTask.execute();
// Action performed when closing the form window
private void formWindowClosing(java.awt.event.WindowEvent evt) {
try {
addUrlsToHistoryFile(historyMem);
catch(IOException exc) {
System.out.println(exc);
/* This method is used to handle the case in which the user clicks on a hyperlink.
In this case the pageEditorPane must present the contents of the URL that was
clicked. This URL is retrieved from the evt object (which is a parameter to this
method) with the method getURL().
private void pageEditorPaneHyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
if(evt.getEventType() == javax.swing.event.HyperlinkEvent.EventType.ACTIVATED) {
RetrievePageTask retrievePageTask = new RetrievePageTask(evt.getURL().toString());
retrievePageTask.execute();
// This method adds the visited URLs to the addressComboBox's item list. It takes as a
// parameter the URL which is going to be added. If the URL is already in the list, then
// it is not added again.
private void addUrlToAddressComboBox(String url_str) {
// number of items in the combo box's list
int itemCount = addressComboBox.getItemCount();
for(int i = 0; i < itemCount; i++) {
if(url_str.equalsIgnoreCase((String)addressComboBox.getItemAt(i)))
return;
addressComboBox.addItem(url_str);
historyMem.add(url_str);
// This method adds the visited URLs to the history file. It takes as a parameter the URL
// which is going to be added.
private void addUrlsToHistoryFile(Vector url_history) throws IOException {
PrintWriter outputStream = null;
try {
outputStream = new PrintWriter(new FileWriter("history.txt"));
for(int i = 0; i < url_history.size(); i++)
outputStream.println((String)url_history.get(i));
finally {
if(outputStream != null) {
outputStream.close();
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
BrowserFrame surfRider = new BrowserFrame();
surfRider.setVisible(true);
// Variables declaration - do not modify
private javax.swing.JMenuItem aboutMenuItem;
private javax.swing.JComboBox addressComboBox;
private javax.swing.JLabel addressLabel;
private javax.swing.JMenuItem exitMenuItem;
private javax.swing.JMenu fileMenu;
private javax.swing.JButton goButton;
private javax.swing.JMenu helpMenu;
private javax.swing.JMenuItem historyMenuItem;
private javax.swing.JButton homeButton;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JMenuBar menuBar;
private javax.swing.JMenuItem openFileMenuItem;
private javax.swing.JEditorPane pageEditorPane;
private javax.swing.JProgressBar pageLoadProgressBar;
private javax.swing.JMenuItem pageSourceMenuItem;
private javax.swing.JMenuItem preferencesMenuItem;
private javax.swing.JButton refreshButton;
private javax.swing.JLabel statusLabel;
private javax.swing.JMenu toolsMenu;
private javax.swing.JMenu viewMenu;
// End of variables declaration
// Variables decleration - able to modify
private Vector<String> historyMem = new Vector<String>();
private String homePage = "http://www.kaissa.gr";
// End of variables decleration
// PUBLIC METHODS
// Get and Set methods for the private variables declared above
public Vector getHistoryMem() {
return historyMem;
public void setHistoryMem(Vector<String> newHM) {
historyMem = newHM;
public String getHomePage() {
return homePage;
public void setHomePage(String newHP) {
homePage = newHP;
}
Maybe you are looking for
-
Space bar leaves ghost spaces after reboot???
This is STRANGE. Not sure if this is the right forum thread. I have a USB Apple Keyboard (aluminum) I bought in March 2009 for my MBP 15" (C2D, late 2006, 2.33MhZ). It has worked fabulously (I had to get used to it; I used to like the MBP keyboard fo
-
I have the Adobe Reader x 10.0.1. Free version. I downloaded a PDF form and open the document but cannot fill in any of the fields. With the form opened I look at File/Properties/security which shows "Filling of the form fields": Allowed. I do not fi
-
Hi All, Given a line from MSEG table, how can I pull all serials numbers related to this particular line item in EQUI? What other tables can link the two? I can use matnr and batch directly to access EQUI but then again two different MSEG line items
-
Web-service publishing error in OSB
Hi friends! Recently I installed Oracle Service Bus, as I need to implement a simple SOA in my research work at the university. I tried to find a simple example to get familiar with OSB, and found one in Definitive Guide to SOA Oracle Service Bus, Se
-
BI Publisher Desktop installation/unistallation
please help I install BI Publisher Desktop on my computer. I used it to create pdf report from a word document. everything worked fine until suddenly the Oracle BI Publisher menu does not appear in my word document. being a beginner in game I thought