Navigation Panel using Java Bean Base API
Hi,
I would like to know how do I add the standar navigation panel to my map using the oracle.lbs.mapclient.MapViewer object. I have try different forms which include adding a tile theme layer but its not working. I'm not using the JS API since I want to have an applet.
Thanks in advance.
Susana
Hi,
in MapViewer's web page there is a link to some demos. There you can find a few examples of how to use the Java bean with jsp pages.
If you want to implement a simple java (desktop) application, the following code contains the basic information that you need to start the MapViewer object, set the display parameters, and then add some information to generate a map image. In this example, a base map is used to generate the map.
String url = "http://localhost:7001/mapviewer/omserver";
try
MapViewer mapViewer = new MapViewer(url); // creates MapViewer object
mapViewer.setDataSourceName("mvdemo"); // sets the data source (must exist in Mapviewer server)
mapViewer.setMapTitle("MVDEMO base map");
mapViewer.setAntiAliasing(true);
mapViewer.setImageFormat(MapViewer.FORMAT_RAW_COMPRESSED);
mapViewer.setDeviceSize(new Dimension(600,475));
mapViewer.setCenterAndSize(-116.65,38.92,19.2); // sets the map area
mapViewer.setBaseMapName("DEMO_MAP");
System.out.println(mapViewer.getMapRequestString()); // this prints the current map request to be issued
boolean response = mapViewer.run(); // executes the request
if (response)
Image img = mapViewer.getGeneratedMapImage();
// do something with the image in your Java application
}catch(Exception ex)
ex.printStackTrace(System.err);
}The API java doc (see APIs link in MapViewer's web page) contains a more detailed description of the methods that can be used with the Java bean API.
Similar Messages
-
How to use Thread.sleep() with Java Berkeley Base API?
Hi,
I have explained the weird problem about the server was too busy to response to SSH but it continued to finish to run (Server not response when inserting millions of records using Java Base API
Even I tried to increase CachSize and renice Java program, but it did not work. So, I am thinking to set sleeping time for threads in Java Berkeley Base API (using “ps” command, there were 18 light weight processes created). My program did not implement transaction or concurrency because it simply creates (millions) databases records only. Is it possible and correct to do like this in the code:
try{
//do create a db record
Thread.currentThread().sleep(1000);//sleep for 1000 ms
catch(ItrerruptedException ie){
Thank you for your kindly suggestion.
Nattiyawhere can I get the help doc about use AT commands in java.
Can you give me some code example about this. It is
difficulty to me to write it myself.You simply have to send the characters and receive the characters via the comm extension. Here is the ITU standard command set - http://ridge.trideja.com/wireless/atcommands/v250.pdf. Various modems and other devices extend this in a number of ways, you may need to find documentation specific to your device as well. But start with the standard. -
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. -
Search in form by using java bean or PJC.
hi all
i am confused because i do not know java bean to much,is it possible to create a search button with one text item in java bean to display all records
example:
if i enter dept 10 then it display all records related to dept 10?
is it possible?
if yes please cany anyone send me a demo?
here is my email add.
[email protected]
sarahhi
Francois thanks for the link and its very useful and i am studying the codes and also i downloaded demos and run them its working fine and its very very nice.
i like java and trying to learn and its very useful.
why i want to use java bean because one of my friend her name is sheela she wants me to do it but i am failed i did not do it in java bean
so i thought lets try on the forum may be someone help u.
so i posted a thread over here.
thanks Francois.
u r appreciated.once again thanks.
sarah -
hello friends,
i'm new to jsp. i want to create an html form that accepts username and a value from four radio buttons and display back the entered name and checked radio button's value using java bean.
i use the <jsp:setProperty id="" property="*"> method. i don't know how to access the radio buttons value from the html.
also when i use an additional field other than username the jsp page is showing error.
Please give me the correct method to use java bean with jsp in this circumstance.
thank you.thank you, but i have a problem left. the case is like this.
i got the jsp and bean worked fine when i have a sinle input text field.
but when i added a second text field i recieved the following error.
javax.servlet.ServletException: basket.newbean.getUserPass()Ljava/lang/String;
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.newform.process_jsp._jspService(process_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
where userPass is the new form element. I have made the subsequent chanes in my bean program and jsp file.
pls hlp. -
Problem with too small page size using Java 2D Printing API.
Hello,
I have problem with resolution of printer using Java 2D Printing API. Despite my printer has 600 x 600 DPI, inside java.awt.print.Printable.print(Graphics, PageFormat, int) I receive page format with 600 x 840 page size.
I have tried to set resolution using javax.print.attribute.PrintRequestAttributeSetand javax.print.attribute.standard.PrinterResolution, but with no result.
Can anybody solve this problem?
Regards,
Karl.600 x 840 is a Point value; Point is defined as 1/72nd of an inch. Printers do have much higher DPI than this, but I believe that this DPI has to do with richness of the printed image, not an actual ability to color with that level of resolution. You might want to try calling zoom on your Graphics2D object. Otherwise, I don't know what else you can try.
-
Why should we use java beans?
Everybody says it is used to set the properties. What does this mean?
Can anyone give me a realtime scenario of the problems it can solve?
How does Spring framework utilize beans to solve problems? i.e wiring beans, declaring them in context file.shalearns wrote:
Why should we use java beans?[http://java.sun.com/docs/books/tutorial/javabeans/index.html]
Everybody says it is used to set the properties. What does this mean?[http://java.sun.com/docs/books/tutorial/javabeans/whatis/index.html]
Can anyone give me a realtime scenario of the problems it can solve?[http://java.sun.com/docs/books/tutorial/javabeans/nb/index.html]
How does Spring framework utilize beans to solve problems? i.e wiring beans, declaring them in context file.[http://static.springframework.org/spring/docs/1.2.x/reference/beans.html]
~ -
How to use Java Beans In JSTL?
Hi
I want to know how to use Java bean in JSTL
please explain this with giving any one example.
Thanks-
SwapneelA bean is obtain by <jsp:useBean> tag nd once bean is obtained we can get its property by using getProperty tag.
-
Help : Unable to use Java Beans in Oracle forms 6i
Hi ,
I have been trying to run few sample code to understand how to use Java beans in oracle forms 6i .But have been largely unsuccessfull.
It will be great if somebody can provide me with some simple form( and java code )which uses java beans concept to give some data to the java program and receive some data from it . Pls inform me about the settings that need to be done.
If you guys know it then pls take the pains of writing a simple form and java code.
i hope somebody will respond because your reply is very necesary for me to proceed.
U can email me the code > [email protected]
Thanks in advance.Thanks for your reply Francois.
Actually i am not facing problem understanding the programming technique.
I think the problem at my end is more of a cofiguration one.I am using forms version 6i
on oracle 8.
Every time i set the imlementation class property of the bean area it gives an error 13010 which translates to that "the class being mentioned is not extending the IView class".
The class i have written extends VBean so i am not sure why this error is occuring.
I think if oracle (correctly) finds the java class to use then i will be able to proceed.
Pls reply.
If you have some code that is working fine then pls send it to me.And also inform is some environment variables have to be set for its use. -
How can I using java bean to insert new record
Hi everybody,
I'd some problem when I insert a record using java bean. When insert a record, the resultset executeUpdate return 0 anc cannot add record to database. Would you please tell me what's wrong in my code?
java bean
package miniproj;
import java.sql.*;
public class Register{
private String sql;
private String username;
private String usertype;
private String password;
private String blocknum;
private int floornum;
private String owner;
private int rows;
private String s;
// set parameter to database
public int setMember(){
try{
//load database driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Get a connection to the database
Connection sqlConn = java.sql.DriverManager.getConnection("jdbc.odbc:WFBS");
// Get a statement from the connection
Statement sqlStmt = sqlConn.createStatement();
sql = "INSERT INTO USERS(user_name, password) VALEUS ('aaa', 'aaa')";
// sql = "INSERT INTO USERS(user_name, password) VALEUS (" + user_name + "," + password + ")" ;
rows = sqlStmt.executeUpdate(sql);
// sqlRst.close();
sqlStmt.close();
sqlConn.close();
catch(SQLException se){
catch(Exception e){
return rows;
// set user name method
public void setUsername(String name){
username = name;
// set passwrod method
public void setPassword(String pwd){
password = pwd;
// set block num mehtod
public void setBlockNum(String block){
blocknum = block;
// set floor num method
public void setFloorNum(int floor){
floornum = floor;
// set owner method
public void setOnwer(String own){
owner = own;
// get user name method
public String getUsername(){
return username;
// get password method
public String getPassword(){
return password;
jsp code
<%@ include file="Header.jsp" %>
<%@ page errorPage="Error.jsp" %>
<jsp:useBean id="register" class="miniproj.Register" />
<jsp:setProperty name="register" property="*" />
User name : <%=register.getUsername()%><br>
Password : <%=register.getPassword()%><br>
<%
int i = register.setMember();
out.println(i);
%>
Thanks a lot
ChrisSeems to me that executeUpdate() would throw an SQLException, which in turn would get caught by your empty catch. The SQL keyword VALUES is misspelled. Put a 'se.printStackTrace()' in your catch to confirm this.
-
Value cannot refresh using Java bean
When I use java bean to get a value. It suppose to refresh and show new value but it doesn't. So any code can help to resolve this issue.
here is my code
(Testing.jsp)
<html>
<head>
<title>Page 3</title>
<link rel=stylesheet type="text/css" href="auction.css">
</head>
<table class="mainBox" width="200">
<tr><td class="boxTitle" >
Testing number 3
</td></tr>
<tr><td>
<span class="headline">
<jsp:useBean id="testing2" class="com.jsp.newsys.testing.Testing2" scope="request">
<jsp:setProperty name="testing2" property="user" value="Hello World"/>
<jsp:getProperty name="testing2" property="user2"/>
</jsp:useBean>
</span>
</td></tr>
</table>
</html>
The bean file which is Testing2.java
package com.jsp.newsys.testing;
import java.beans.*;
import java.util.*;
public class Testing2 extends Object implements java.io.Serializable {
private String user;
private String test;
public Testing2() {
public void setUser(String user)
test="";
if (user.equals("Hello World"))
test="Hi dqwqwd";
public String getUser2()
return this.test;
I need to restart my tomcat everytime then only the value will refresh. Please help.
Message was edited by:
wesleygch
Message was edited by:
wesleygch
Message was edited by:
wesleygchYour bean maybe have misspelling error
look at test and test2 on the jsp file. But I couldn't find any bean property test2 in your bean. Maybe you should try
${testing2.test} instead of ${testing2.test2}
I am a new bie also....:-) -
How can I get selected EXCEL area using java script office API (v 1.0)
Hello everyone,
I need to get values of specified area in an excel sheet using java Script Office API. For an example,
A1:A7 row load into array using JS.And you posted to a C++ forum, not a JavaScript or Excel forum.... why?
Visual C++ MVP -
Upload to Excel using Java Bean
Hi
My requirement is that to upload the data to an excel sheet from a JTable(JTable is actually a java bean which gets its input from forms) and the user need to be given either to view the excel/save the excel/print the excel in any of the networked printers.
Please cud someone help me with their inputs.
Thanks again
Deepacan you send me your code bean and form?
I have example that i can send you to export to excel using webutil and OLE object. -
Crystal Reports data connection using Java beans
Hi
My name is Bach Ong, i'm currently perform re-configuring Crystal reports 2008 to connect via
Java bean to Jboss server, this uses look up service on JBoss server. The connection is using Connect
look up using the properties:
java.naming.provider.url=jnp://emgsydapp121:10499
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
for file CRConfig.xml i put as follows:
<JDBCURL></JDBCURL>
<JDBCClassName></JDBCClassName>
<JDBCUserName></JDBCUserName>
<JNDIURL>jnp://emgsydapp121:10499</JNDIURL>
<JNDIConnectionFactory>org.jnp.interfaces.NamingContextFactor
y</JNDIConnectionFactory>
<JNDIInitContext>/</JNDIInitContext>
<JNDIUserName></JNDIUserName>
Can you advise us if this step is correct, and is there any
documentation that can guide us to right direction.
for Java testing in Eclipse using remote call class it is working suing the following code:
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://emgsydapp121:10499");
InitialContext ctx = new InitialContext(p);
Date asAtDate = CrystalUtils.convertToDate("2014-01-01", CrystalUtils.relativeToToday(0), false);
String asxCode = "BHP";
ClosingPricesReportRequest criteria = new ClosingPricesReportRequest(asAtDate, asxCode);
InitialContext context = new InitialContext(p);
ClosingPricesReportService ejb = (ClosingPricesReportService) context.lookup(ClosingPricesReportService.REMOTE_JNDI);
ClosingPricesReport report = ejb.createMTMClosingPriceReport(criteria);
System.out.println(report.getClosingPrices()[0].getClosingPrice());
testval = report.getClosingPrices()[0].getClosingPrice().toString();
System.out.println(testval);
when i run the tes code the results as follow:
10:49:45,244 DEBUG [SecurityAssociation ] Using ThreadLocal: false
10:49:45,338 DEBUG [MicroSocketClientInvoker ] SocketClientInvoker[709446e4, socket://emgsydapp121:10473] constructed
10:49:45,338 DEBUG [MicroRemoteClientInvoker ] SocketClientInvoker[709446e4, socket://emgsydapp121:10473] connecting
10:49:45,338 DEBUG [MicroSocketClientInvoker ] Creating semaphore with size 50
10:49:45,338 DEBUG [MicroRemoteClientInvoker ] SocketClientInvoker[709446e4, socket://emgsydapp121:10473] connected
10:49:45,369 DEBUG [ClientSocketWrapper ] reset timeout: 0
10:49:45,650 DEBUG [InvokerRegistry ] removed SocketClientInvoker[709446e4, socket://emgsydapp121:10473] from registry
10:49:45,650 DEBUG [MicroSocketClientInvoker ] SocketClientInvoker[709446e4, socket://emgsydapp121:10473] disconnecting ...
10:49:45,650 DEBUG [SocketWrapper ] ClientSocketWrapper[Socket[addr=/10.137.2.40,port=10473,localport=64150].2cba5bdb] closing
37.99000000000000198951966012828052043914794921875
37.99000000000000198951966012828052043914794921875
Can anyone assist me in convert the above settings to get access by Crystal reports.
My attemp current are below:
public class CFDClosingPricesRpt extends CrystalReport {
//Constructor
public CFDClosingPricesRpt(){
super(ClosingPriceBean.INSTANCE);
* Returns the ResultSet for this report to Crystal.
* @param asxCode
* @param asAtDateString
* @return
public ResultSet getNewReport(String asxCode, String asAtDateString) {
try {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://emgsydapp121:10499");
//InitialContext ctx = new InitialContext(p);
clearCachedReportBeans();
Date asAtDate = CrystalUtils.convertToDate("2013-01-01", CrystalUtils.relativeToToday(0), false);
asxCode = "BHP";
ClosingPricesReportRequest criteria = new ClosingPricesReportRequest(asAtDate, asxCode);
//ClosingPricesReportService ejb = (ClosingPricesReportService) ctx.lookup(ClosingPricesReportService.REMOTE_JNDI);
ClosingPricesReportService ejb = (ClosingPricesReportService) ServiceLocator.getInstance().getService(ClosingPricesReportService.REMOTE_JNDI);
ClosingPricesReport report = ejb.createClosingPriceReport(criteria);
// assemble Crystal-friendly DTO
Collection closingPrices = Arrays.asList(report.getClosingPrices());
for (Iterator iter = closingPrices.iterator(); iter.hasNext();) {
MBLXClosingPrice cp = (MBLXClosingPrice) iter.next();
if (cp==null) continue;
addReportBean(new ClosingPriceBean( report.getSuppliedDate(),
cp.getClosingPrice(),
cp.getAsxCode()));
} catch (Throwable x) {
saveErrorMessage(x);
return getAsResultSet();
Thanks
Bach OngHi Don Thanks for the reply.
I've was able to connect via Java beans and JNDI. But this one is going the JNDI of JBoss sever, which the JNDI already configure and working for Crystal reports v10.
Bach -
How to upload a file using java bean?
hi,
i need a code simple how to upload a file from jsp form to a java bean file (not a servlet)
thank,s zikHi,
i need a code sample how to upload a file from jsp
form to a java bean file (not a servlet)You can use jspSmartUpload component which is a free, fully-featured JSP component.
jspSmartUpload provides you with all the upload/download features you could possibly wish for :
* Simple and complete upload
* Total control over the upload process
* �Mixed forms� management
* Total control over files sent
* Download whatever you want
For further information about jspSmartUpload please visit
http://www.jspsmart.com/
Hope this helps.
Good Luck.
Gayam.Srinivasa Reddy
Developer Technical Support
Sun Micro Sysytems
http://www.sun.com/developers/support/
Maybe you are looking for
-
I am attempting to distribute Adobe Flash updates using SCUP 2011, SCCM 2012 R2, WSUS ver4 and Windows Server 2012. Everything installs without error. I have acquired a certificate for SCUP signing from the internal Enterprise CA. I have verified
-
I need some help with a query that I need to use in order to create a view. It's fairly complicated, at least for me. Here is a short summary of the problem: There is a table involved called salesperson. This table has a four digit salespersonid, las
-
IPhone 6 Music Sync puts music on phone but I can't play from the phone
I synced my new iPhone sync using my mac (latest software). It took forever for iTunes to sync putting only one playlist on the phone (900 songs). I got in the car, connected the phone and can access only 4 songs. It shows all the songs but they are
-
TS1702 I can't download any google apps.
I can download and use any other app just fine. When I try to hit "install app" it just goes back to "free." How to I fix this? I have restarted it and nothing has worked.
-
Distiller Suddenly Shuts Down during pdf creation...
Never had a problem in Acrobat 6.0.1 on Mac OS 10.4.1. Suddenly, Distiller takes all .ps or .eps files to almost 100% of pdf creation, then crashes. Says "Can't process job because PDFLib failed to initialize." Might have happened after I used "Font