Howto use java with html
Hi,
I have got following project :
an axis webcam displays an image thanks to http protocol
at the right of my image, I have to create a panel with some java controls.
I would like some hints on howto do this?
Do I need a to setup a web server or is it possible to do this using a single html file loaded in my browser ?
Best Regards
Steph
At best you can load an applet in a html page (the other possibility is to use servlets and JSP's to do server side processing, which is most likely not what you want to do).
But what do you want to do with these "java controls"?
Similar Messages
-
How to use Java with PL/SQL commands to send an email with attachment
Apologizes in advance if this is the wrong place to ask the question.
I need to use Java with PL/SQL commands to send an email with attachment. My java application runs from the command line and does some magic to gather info from an Oracle 11g db. If the DB has sendmail configured, I'd like to send the results of the data gathering as an attachment to the email addresses. I'm not sure how to do this. I've been reading up on on PL/SQL can send email with UTL_SMTP - with attachments. I'm just not sure how to translate that into being triggered by my Java application. Any suggestions or pointers on what I should read would be appreciated.
Background - I've been programming in Java for 10+ years, but this is my first time using databases. I also have been on these forums for a long time, but lost my profile when it was switched to Oracle.
Thanks for all help.user13726880 wrote:
The original requirements were put together and given to me, an Oracle newbie. They expected the Java app to use something intrinsic to Oracle and Unix sendmail. To solve my problem, I use a JDBC connection to run some SQL commands. I take that data, format it and send the results by email to the user. By default the requirement is to send it as an HTML attachment using Unix 'sendmail'. So I do that using Runtime exec. I have also added JavaMail functionality as an alternative to sendmail. It works great and as expected.Sounds like a reasonable solution.
Note however that PL/SQL itself can send email. And PL/SQL can call unix sendmail too.
However myself I would have done it in java with JavaMail. -
Hi, just a quick question.
Im completely new to java, is it possible to use java with a HTML front end?(im also using vbscript/javascript for user registration purposes etc)
Im trying to create a secure payment system for a website im creating.
Thanks.Try looking into Java Web Services and J2EE. There is a wealth of technology from Servlets to JSP pages to help you to do this.
-David -
How to read azure storage data using JAVA with REST API
Hi,
We have a cloud service in our lab. We have enabled diagnostics
in cloud services. So WADPerformanceCounterTable was created in storage account. Now , We want to read the WADPerformanceTable using
JAVA with REST API. Is there any way to collect these details. please give me any
sample code to connect azure storage using table service REST API.
Thanks & Regards
RathideviHi,
Please have a look at this article:
https://convective.wordpress.com/2010/08/18/examples-of-the-windows-azure-storage-services-rest-api/, it demonstrate how to use table service Rest API, it also give us the code, hope this helps. Of course, the
MSDN article could also help us coding.
Best Regards,
Jambor
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Accessing BAPI's using JAVA with out using webdynpro URGENT
hi Experts,
What is the procedure for calling RFC/BAPI's using JAVA with out using the webdynpro. Please let me know what are the possibilities with step by step implementation.
Regards
VijayHi Boris Rubarth,
Thaks for relavant information.
I have kind of the requirement. The clinet is asking for connecting the SAP RFC using java application. The build Jar or .war or .Ear for which are going to develop should be compatible for running on any of the Applications server like they have Tom cat, weblogic, websphere server.
so the .jar for or .ear file which we are going to develop should be able to run accessing the RFC/ BAPIs from any of these servers other than SAP WAS that is what their target.
Please give me your suggestion, which is better approach. currently their SAP system is 4.6c . So presently it is not possible the webservice approach. But they have plans to go for upgrade to ECC6.0
In that case only JCO option is possible. If use this option . Is it possible to access application which is deployed irrespective of the WAS by doing the required configuration.
Basically i am aware of the ABAP webservice work bech steps and also the JAVA coding also.
Please suggest me what is the better way to achieve this.
Regards -
How to generate reportdesign dynamically using java with out xml file
hi
how can i generate a reportdesign dynamically using java with out passing xml file to jasperDesign , i want to create my reportdesign with out xml file
how can i ,please help
thanksLiveCycle does provide a Java API to forms; LiveCycle is in fact a suite of programs, mostly enterprise level for running on server (next to which the cost of the master suite is a drop in the ocean). LiveCycle Designer is perhaps the only end user tool, and it is not for server use and doesn't have an API.
Are you looking for a server solution? If so, nothing in the master suite can help, it isn't for server use. -
HOWTO: Use BC4J With or Without DB Triggers
This HowTo describes how to use BC4J, database sequences and triggers
and what are the ramifications.
INTRODUCTION
BC4J has the ability to work with database sequences in order to obtain a
unique value when inserting records. BC4J also has the ability to
work either with a 'before insert' trigger which automatically creates
a new unique value for the primary key or without a trigger. When not using
a database trigger, BC4J also has the ability to obtain the sequence value
and set the primary key value.
Before discussing the ramifications of using one approach or the other, let's
show examples of how to use both approaches:
BC4J & sequences WITH a database trigger
and
BC4J & sequences WITHOUT a database trigger
HOWTO DEMONSTRATION STEPS
To illustrate both scenarios a simple database setup script is provided which
creates two tables:
CUSTOMER_NT which DOES NOT have a before insert trigger and
CUSTOMER_WT which DOES have a trigger.
Database Install Script:
<code>
drop trigger customer_insert_trigger;
drop table customer_wt;
drop table customer_nt;
drop sequence customer_wt_seq;
drop sequence customer_nt_seq;
create sequence customer_wt_seq start with 1;
create sequence customer_nt_seq start with 101;
create table customer_wt(
id number,
name varchar2(30),
constraint
customer_wt_pk
primary key (id)
create table customer_nt(
id number,
name varchar2(30),
constraint
customer_nt_pk
primary key (id)
prompt Inserting data...
insert into customer_wt (id, name)
values (customer_wt_seq.nextval, 'Mickey');
insert into customer_wt (id, name)
values (customer_wt_seq.nextval, 'Goofy');
insert into customer_nt (id, name)
values (customer_nt_seq.nextval, 'Daffy');
insert into customer_nt (id, name)
values (customer_nt_seq.nextval, 'Porky');
commit
prompt Creating trigger
create trigger customer_insert_trigger
before insert on customer_wt for each row
begin
select customer_wt_seq.nextval into :new.id from dual ;
end;
</code>
The next step is to create the DEFAULT Entity Objects and View Objects using
the Business Components Wizard.
USING BC4J WITH A DATABASE TRIGGER
Let's modify the entity object CustomerWt so it can use the database trigger.
Edit the entity object CustomerWt by right-clicking in the navigator.
Click on the 'Attribute Settings' tab and edit the ID attribute.
- Uncheck 'Mandatory'checkbox. This allows you to insert without a value for the primary key
- Check 'Refresh after Insert'. This obtains the value from the database generated by the trigger.
- Check 'Updateable While New'. Id is only updateable when inserting.
Click finish to complete the wizard. Save all and recompile the project.
Now let's test our work.
In the navigator right-click the application module and select 'Test..'. This will launch
BC4J's built in tester. Connect to the application.
In the tester double-click the CustomerWtView view object to run a test edit form.
After the edit form renders, navigate through the existing records using the navigate
buttons on the edit form. Now let's insert a record to execute the trigger.
click on the '+' button to insert a record. Enter a value in the 'Name' field and commit the change.
Observe that a new value has automatically been inserted into the Id field.
That's it! You have successfully used BC4J and a database trigger.
Now let's try it without a trigger..
USING BC4J WITHOUT A DATABASE TRIGGER
Now edit the entity object CustomerNT so it doesn't need a database trigger.
Similar to before, edit the entity object CustomerNt by right-clicking in the navigator.
Click on the 'Attribute Settings' tab and edit the ID attribute.
- Uncheck 'Mandatory'checkbox.
- Check 'Updateable While New'.
An additional step is also required. The Create method will have to be modified to extract
the value of the sequence.
In the Edit EntityObject Wizard click the Java tab and select Create method and click Finish.
The create method is generated in your Java fil e. In the Workspace view of the Navigator,
expand the CustomerNt entity object in the navigator. Double-click
CustomerNtImpl.java to open it in the Source Editor. In the Structure pane, double-click
create(AttributeList). Modify the Create method so it looks like this:
<code>
public void create(AttributeList attributeList) {
super.create(attributeList);
SequenceImpl s = new SequenceImpl("customer_nt_seq", getDBTransaction());
Integer next = (Integer)s.getData();
setId(new Number(next.intValue())); }
</code>
Save and compile the project.
Now test the ViewObject CustomerNtView using the tester as before.
In the edit form of CustomerNTView click on the '+' to insert a record. Observe that
just as before a new value has automatically been inserted in the ID field!
TO USE A DB TRIGGER OR NOT TO USE A DB TRIGGER.
Using a Database trigger sometimes preferable if you have non BC4J applications
also sharing the database. In this case it is still safest to just let the database
update it's own primary keys.
If you don't have any other non-BC4J applications sharing the database, then not using
a database trigger is perfectly acceptable and can have slightly better performance.
The important thing to remember is that the option is yours to use either approach!
nullThank you for the reply Jonathon. I am using a ViewObject which
consist of several tables. I haven't tried the DB trigger
approach but just using the BC4 approach in overriding the
create method.
Here is the parent class create as a part of the
FasNameImpl.java file which does the job correctly.
public void create(AttributeList attributeList) {
super.create(attributeList);
SequenceImpl l_seq = new SequenceImpl
("SEQ_CUSTOMER_ID",getDBTransaction());
Integer l_next = (Integer)l_seq.getData();
setCustomerId(new Number(l_next.intValue()));
This is when I triedpassing the value to the child table. But I
can't figure it out. I think the link is working fine if I had a
ViewLink deployed but it doesn't look like it's doing the job
for ViewObject.
I am trying to call the childclass.method
(FasCustomer.setCustomerId(l_next);
But I am getting error.
Thanks a lot for your suggestions,
Kamran
703 696 1121 -
Access database using Java from HTML webpage
Hi,
I've got to create some online maths tests to be taken by students with their marks being stored in a database.
I've wrote some simple java code which can add/remove and modify entries in a test mySQL database that I made. What I now need to do is be able to add entries to the database from a html page.
The math tests will be java applets with the students having to interact according to questions, press submit and their score will be output. The score will then be entered into the database.
The problem I'm having is that with an Applet their are all sorts of security issues (I'm having problems getting images to load in an Applet) so assume I'll face the same security issues when I try to access a database through an applet.
So, could someone please help get started.
CheersMVC - I assume you mean model-view-control and not Marvel vs Capcom :)
If so then does this mean I should completely seperate the user interface (the actual applets that will contain the test), the database (that will store the results) and the link between the two?
is it possible to acheive this using Java, Java Applets, Java Script and the database (in my case mySQL) and could you give me some tips on how best to tackle the problem.
Thanks -
Junk characters display while using multipart with html content in Javamail
Hi All,
I have used Java mail API to send mail with attachment. To enable to attachment in mail and to do content formatting i have used multipart and html content type together.
My web application runs on apache tomcat 5.5 in MAC server. Java version is 1.5.
The Function which i have used for sending mail with attachment is as follows:
public void sendmailAttached(String to,String from,String host,boolean debug,String mailContent,String mailSubject,String cc,String attachFiles)
String mailarray[]=to.split(";");
Properties props = new Properties();
//props.put("mail.smtp.port","425");
props.setProperty("mail.smtp.host", host);
if (debug) props.setProperty("mail.debug", ""+debug);
Session session = Session.getInstance(props, null);
session.setDebug(debug);
try {
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
javax.mail.internet.InternetAddress[] toAddress=new javax.mail.internet.InternetAddress[mailarray.length];
for (int i=0;i<mailarray.length ;i++ )
toAddress=new javax.mail.internet.InternetAddress(mailarray[i]);
msg.setRecipients(Message.RecipientType.TO, toAddress);
msg.setSubject(mailSubject);
try{
String ccaray =cc;
String mailarray1[]=ccaray.split(";");
javax.mail.internet.InternetAddress[] CCAddress=new javax.mail.internet.InternetAddress[mailarray1.length];
for (int i=0;i<mailarray1.length ;i++ )
CCAddress[i]=new javax.mail.internet.InternetAddress(mailarray1[i]);
msg.setRecipients(Message.RecipientType.CC,CCAddress);
}catch(Exception ss)
System.out.println("CC mail exception is ====>"+ ss.getMessage());
msg.setSentDate(new java.util.Date());
Multipart multipart = new MimeMultipart("related");
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(mailContent, "text/html");
multipart.addBodyPart(messageBodyPart);
String fileName = attachFiles.substring(attachFiles.lastIndexOf("/")+1,attachFiles.length());
if(!fileName.equals(""))
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(attachFiles);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(fileName);
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
Transport.send( msg );
catch(MessagingException mex)
Exception ex = mex;
if (ex instanceof SendFailedException)
SendFailedException sfex = (SendFailedException)ex;
Address[] invalid = sfex.getInvalidAddresses();
if (invalid != null) {
if (invalid != null) {
for (int i = 0; i < invalid.length; i++)
System.out.println("Invalid Addresss --------> " + invalid[i]);
try
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
Multipart multipart = new MimeMultipart("related");
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(mailContent, "text/html");
multipart.addBodyPart(messageBodyPart);
Address[] validUnsent = sfex.getValidUnsentAddresses();
javax.mail.internet.InternetAddress[] toAddress=new javax.mail.internet.InternetAddress[validUnsent.length];
if (validUnsent != null) {
for (int i = 0; i < validUnsent.length; i++)
System.out.println("Valid Address ------>"+validUnsent[i]);
String test = validUnsent[i]+"";
toAddress[i]=new javax.mail.internet.InternetAddress(test);
msg.setRecipients(Message.RecipientType.TO, toAddress);
msg.setSubject(mailSubject);
String fileName = attachFiles.substring(attachFiles.lastIndexOf("/")+1,attachFiles.length());
if(!fileName.equals(""))
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(attachFiles);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(fileName);
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
Transport.send( msg );
catch(Exception e)
System.out.println("Mail Not Send");
else
System.out.println("Mail Server Not Connectd ");
This code is working properly and i am able to send mail with attachment and html formatted content without any problem. But console of server is filled up with too much junk characters because of which the catalina.out file of tomcat server is becoming fully filled.
Sample cosnole display with junk characters are as follows:
Subject: HBSP - DRUCKER - QC - CH16 - QC R2 Completed
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_34_15681668.1247471518887"
------=_Part_34_15681668.1247471518887
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<b>Hi,</b><br><br> Chapter CH16 in the project DRUCKER is Completed . <br><br> <b>Comments :</b> Qc Accepted.<br><br> <b><i>Thanks,<br>ANTONY.</i></b>
------=_Part_34_15681668.1247471518887
Content-Type: application/octet-stream; name=9420317_CH06_p084-119.pdf.zip
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=9420317_CH06_p084-119.pdf.zip
UEsDBBQAAAAIAMOz6TqHaQ4BUtXhAGzP8QAZAAAAOTQyMDMxN19DSDA2X3AwODQtMTE5LnBkZsQ7
CTxUX9tCUpIWEomxpoWZuTN3FmvW7P9skaUajCXGiCHSYiuKFrIvlWStROSvaBEtiIpkK5WlUipa
ZKl898wYRP/37fve7/e69TjnPuc5z3LOuc95zjP3ym7S1lXAKuL5ZTu7HjTyL8ATiCgMiu6wA6Wi
gjZy86RSvN12U51QWLQRCguT8ESISED/hcITMWgdFJZIgPAwBm2CwhHQFqAdRySRcWg9lC2KBBNQ
WAIRZ6+mxk/1dEI48qNYF7+/N9WZHwiCSPyY8QtLQDFLlCf/AhYGgiHyDBwBIs7EETEzcCR4Bg6H
IZBn4LBE7AwcNBOHJ87EwWQ8aTqOgIWJM3C4mX2JMH6GLiQiHjMDR8bD03BYDBYizcDh8LjpOCyM
xczAETH4mbgZOmNhmDCDHwE7Qz+IhMNO54eHCKTp/GAcboYuBBJMmi6DSIZxU+lYF7KSJnEMb4qb
B9WbH1md5sjCROHJMHqTN9VvfPGRcGgzOp2BwhOQMUKZofU9nenIDYF1o22rgtXU1EWGRgsia2vp
Like this display of junk characters are filling up multiple pages of console file.
Can any one suggest me how to overcome this problem?
Many thanks in advance.There is no "sendmail" method in the JavaMail API.
The debug flag is set using the Session.setDebug method, or by setting the Session property "mail.debug".
If you're using someone else's helper classes with JavaMail, they may provide another way to set it. -
I cannot use JAVA with Firefox but I can use it with Internet Explorer WHY?
I have never had a problem when JAVA 7 was needed to use a program. Until now. Firefox will not allow me to use Java. I have to open Internet Explorer when working with any program and it works.
To protect Firefox users, Mozilla has blocked/disabled Java 7 u6 and below due to serious security flaws in the previous versions of Java 7. The security flaw would also apply to any other browser using the affected versions of Java 7. You can see the version of Java and whether it is disabled in Add-ons > Plugins; look for "Java Platform SE...". See - https://addons.mozilla.org/en-US/firefox/blocked/p138
You can check your '''''enabled''''' Plugins at any time - https://www.mozilla.org/en-US/plugincheck/
Information about Java, testing and updating it - https://support.mozilla.org/en-US/kb/use-java-plugin-to-view-interactive-content -
Can I use Java with SQL Server CE edition?
Hi,
Can anybody tell me whether I can use Java to program the database operations for SQL Server CE?Hi:
I have the same question. I don't know java how to connect the Microsoft SQL Server CE. Do you know the answer now? Please let me know. Thank you very much.
chia-li
[email protected] -
I want to use Java to develop DMI. Please help...Thanks.
You are not getting replies because your question may need a course to answer. Just like, hey, can someone tell me how to write an email application? Or,
Can someone show me how to build a house?
Start writing your application, when you get stucked, post your questions.
Or, at least be more specific. Like, elaborate DMI and things like that.
Do a search on DMI, you may find what you need. -
Using Java with Oracle Spatial
I am using the JDBC (Java classes dowloaded from
technet.oracle.com - (sdoapi.zip)) together with Oracle Spatial
8.1.6. I am writing a collection of Linestrings into Oracle
Spatial using the supplied java classes(sdoapi.zip). I use the
function createGeometryCollection(myCollection)to write the
Linestring collection to Oracle Spatial and they are written to
the database without error. However, when I try to read the
object back I get the following error:
Exception in thread "main"
oracle.sdoapi.geom.InvalidGeometryException
at oracle.sdoapi.adapter.AdapterSDO.importGeometry
(AdapterSDO.java:101)
at
MapInfoToOracleSpatial.MapInfoToOracleSpatial.main
(MapInfoToOracleSpatial.java:211)
I do not have a listing of this code so can you please tell me
what the error is (line of code) at line 211. Also, when I use
the Oracle Spatial Index Advisor to view the spatial data, it
only displays a quarter of the data. When I use MapInfo to view
it's equivalent TAB (Table) file it views correctly all the
data.
I can't understand why this is happening because the writing to
oracle and creation of each individual linestring does not
throw an error. It is only when I try to read back larger
objects from the database (2500 points) that it gives an error.
Is there a limitation on the size one can create linestrings?
Thanks
Regards
Stephen Syrett
Mobile Telecommunications Network
(MTN) South AfricaLatest Oracle Openworld Spatial/MapViewer activities list:
http://www.oracle.com/us/products/database/options/spatial/ssLINK/oow10-focuson-spatial-169204.pdf
thanks
LJ -
I've got several html pages that I made to use SSI's. The code would go like:
<div class="footer">
<!--#include file="../ssi/footer.html" -->
<div class="clr"></div>
But when I preview the page on the server, it's not showing the code. If I bypass the SSI and paste the html code in directly it shows.
I'm sure the path is correct. I can browse to it and I've also tried putting in the whole url just incase DW's Insert messed up.
Inserting SSI's works fine with php files, but when I try it in htm files I can't get it to work.
Is there something I'm doing wrong?Also, change this
<!--#include file="../ssi/footer.html" -->
to this:
<!--#include virtual="../ssi/footer.html" -->
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb -
Howto use Scroller with SkinnableContainer?
Hi, I just installed the Flash Builder Beta 2 and the code which worked in the previous Beta 1 version cannot be compiled now:
<s:Scroller>
<s:SkinnableContainer>
.... (some content here)
</s:SkinnableContainer>
</s:Scroller>
The Flash Studio developers probably changed the Scroller implementation, so now can Scroller contain only Group or DataGroup?
Knows anybody how to use the Scroller with the SkinnableContainer???
Thanks
FipilThank you for the reply Jonathon. I am using a ViewObject which
consist of several tables. I haven't tried the DB trigger
approach but just using the BC4 approach in overriding the
create method.
Here is the parent class create as a part of the
FasNameImpl.java file which does the job correctly.
public void create(AttributeList attributeList) {
super.create(attributeList);
SequenceImpl l_seq = new SequenceImpl
("SEQ_CUSTOMER_ID",getDBTransaction());
Integer l_next = (Integer)l_seq.getData();
setCustomerId(new Number(l_next.intValue()));
This is when I triedpassing the value to the child table. But I
can't figure it out. I think the link is working fine if I had a
ViewLink deployed but it doesn't look like it's doing the job
for ViewObject.
I am trying to call the childclass.method
(FasCustomer.setCustomerId(l_next);
But I am getting error.
Thanks a lot for your suggestions,
Kamran
703 696 1121
Maybe you are looking for
-
Unable to load German characters in NON Unicode Essbase Cube
Hi Guys, This is what we want to do: Build a Cube for Germany on our Essbase server in US. Our users will access cube using Excel Add-In from Germany. But since the Essbase server is in US, system environment variable ESSLANG is set to English_United
-
Hi All, In my requirement Financial year starts from Nov to Oct. According to This in FEB 14 its 2014 Q2. My query is like below SELECT 'Q'+DATENAME(Quarter, CAST(CONVERT(VARCHAR(8), Getdate()) AS DATETIME)) But it is giving result Q1. how i can make
-
Save as template kill the web part connection
Hi, I have a Sharepoint web site and I would like to save it as a template in order to create several site with the same structure and the same web pages. On some of my web part pages I have some webpart connected to each other (mostly BDC List web p
-
Instead of accents on letters for foreign language, I get strange symbols.
me email messages in French have strange symbols instead of accents. How can Firefox correct that?
-
Change validity end date on activity type
Is there a way to change the validity end date of an activity typre. Currently it is 9999 we would like to change it to 2011. We would like to use a particular activity to cost current standards but dont want to use it for planned estimates that we w