MVC with fxml

Hello,
I have a question concerning fxml, Is it true that the only possible link between fxml view and Model is done through controller?
Edited by: 914170 on 11 oct. 2012 06:47

I'm not sure there is anything in JavaFX where there is only one possible way to do it ;).
You certainly can map a model to the view directly in the FXML. The easiest example is where the model follows Javabeans conventions (no-arg constructor and get/set methods). Then you can instantiate your model directly in the FXML. If you want something more complex you can use a factory or builder to access the model.
Here's the simplest example I can do. Here's a model:
Model.java
package mvc;
import javafx.beans.property.ListProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
public class Model {
     private SimpleListProperty<String> items ;
     public Model() {
          items = new SimpleListProperty<String>(FXCollections.observableArrayList("One", "Two", "Three"));
     public ListProperty<String> itemsProperty() {
          return items ;
     public ObservableList<String> getItems() {
          return items.get();
     public void setItems(ObservableList<String> items) {
          this.items.set(items);
}And here's the view:
MVCDemo.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.control.ListView?>
<?import mvc.Model ?>
<BorderPane xmlns:fx="http://javafx.com/fxml">
     <fx:define>
          <Model fx:id="model" />
     </fx:define>
     <center>
          <ListView items="${model.items}" />
     </center>
</BorderPane>And the startup:
MVCDemo.java
package mvc;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class MVCDemo extends Application {
     @Override
     public void start(Stage primaryStage) throws Exception {
          Parent root = FXMLLoader.load(getClass().getResource("MVCDemo.fxml"));
          Scene scene = new Scene(root, 400, 400);
          primaryStage.setScene(scene);
          primaryStage.sizeToScene();
          primaryStage.show();
     public static void main(String[] args) {
          launch(args);
}You can access the model in the controller using injection in the usual way:
@FXML Model model ;

Similar Messages

  • Scenebuilder not working with FXML that works fine otherwise

    Hi ~
    I'm using the Mac version of Scenebuilder (1.0), integrated with NetBeans, and although it works fine for simple (sample) apps, for my application it does not.
    IOW, I can run my application fine, looks great, but Scenebuilder gives the following error when I attempt to open the FXML file with Scenebuilder (rather than edit it with NetBeans):
    "Error loading file"
    "Cause is File is not a valid FXML file"
    How do I troubleshoot this? (Also, is there a thread or link that shows how to download and install over my current version with the latest 'trunk' version of Scenebuilder for Mac OS X -- Lion in my case -- to try out later builds?)
    Thanks
    ~ Brad
    PS UPDATE: What I'm running (w/JavaFX 2.2):
    Product Version: NetBeans IDE 7.2 (Build 201207171143)
    Java: 1.7.0_06; Java HotSpot(TM) 64-Bit Server VM 23.2-b09
    System: Mac OS X version 10.7.4 running on x86_64; US-ASCII; en_US (nb)
    Edited by: 960618 on Sep 21, 2012 10:32 AM

    I edited your sample fxml and made some changes (replaced the commented out lines other lines) which allowed the fxml to at least load in SceneBuilder.
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.image.*?>
    <?import javafx.scene.text.*?>
    <?import javafx.scene.paint.*?>
    <AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="1000.0" xmlns:fx="http://javafx.com/fxml">
      <ImageView fitHeight="58.5" fitWidth="152.0" layoutX="15.0" layoutY="15.0" pickOnBounds="true" preserveRatio="true">
      <image>
        <Image url="@mygraphic.jpg" preserveRatio="false" smooth="false" />
      </image>
      </ImageView>
    <!--  <Label fx:id="label1" alignment="CENTER" contentDisplay="CENTER" layoutX="167.0" layoutY="15.0" minHeight="16.0" minWidth="583.0" prefHeight="33.0" prefWidth="304.0" text="my title text" textFill="#004166">-->
      <Label id="label1" alignment="CENTER" contentDisplay="CENTER" layoutX="167.0" layoutY="15.0" minHeight="16.0" minWidth="583.0" prefHeight="33.0" prefWidth="304.0" text="my title text" textFill="#004166">
        <font>
          <Font name="Optima Bold" size="28.0"/>
        </font>
      </Label>
      <Label id="label2" alignment="CENTER" contentDisplay="CENTER" layoutX="167.0" layoutY="48.0" minHeight="16.0" minWidth="583.0" prefHeight="33.0" prefWidth="302.0" text="my subtitle">
        <font>
          <Font name="Optima Bold Italic" size="22.0"/>
        </font>
        <textFill>
    <!--      <Color blue="0.400" green="0.255" red="0.000" fx:id="x1" />-->
          <Color blue="0.400" green="0.255" red="0.000" />
        </textFill>
      </Label>
      <VBox id="VBox" alignment="CENTER" layoutX="0.0" layoutY="104.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="217.0" spacing="4.0">
        <children>
    <!--      <Label id="myLabel"   alignment="CENTER_RIGHT" contentDisplay="CENTER" font="$x2" minHeight="-Infinity" minWidth="-Infinity" prefHeight="22.0" prefWidth="185.0" text="label text:" textFill="$x1" VBox.vgrow="SOMETIMES" />-->
          <Label id="myLabel"   alignment="CENTER_RIGHT" contentDisplay="CENTER" font="$x2" minHeight="-Infinity" minWidth="-Infinity" prefHeight="22.0" prefWidth="185.0" text="label text:" VBox.vgrow="SOMETIMES" />
        </children>
      </VBox>
      <VBox id="VBox" alignment="CENTER" layoutX="202.0" layoutY="104.0" prefHeight="235.0" spacing="4.0">
        <children>
          <ChoiceBox id="myChoiceBox" minHeight="-Infinity" minWidth="-Infinity" prefHeight="22.0" prefWidth="240.0" />
          <TextField id="myTextField" minHeight="-Infinity" minWidth="-Infinity" prefHeight="28.0" prefWidth="240.0" promptText="myPromptText" />
    <!--      <ChoiceBox fx:id="myChoiceBox" minHeight="-Infinity" minWidth="-Infinity" prefHeight="22.0" prefWidth="240.0" />
          <TextField fx:id="myTextField" minHeight="-Infinity" minWidth="-Infinity" prefHeight="28.0" prefWidth="240.0" promptText="myPromptText" />-->
        </children>
      </VBox>
    <!--    <Button layoutX="40" layoutY="505" text="Detect" onAction="#handleDetect" fx:id="buttonDetect" />
        <TextArea layoutX="465" layoutY="104" minHeight="390" minWidth="450" fx:id="textAreaLog" />
        <TextArea layoutX="465" layoutY="503" minHeight="55" minWidth="450" prefHeight="56" prefWidth="450" fx:id="textAreaMessage" promptText="Notifications" />-->
        <Button layoutX="40" layoutY="505" text="Detect" onAction="#handleDetect" id="buttonDetect" />
        <TextArea layoutX="465" layoutY="104" minHeight="390" minWidth="450" id="textAreaLog" />
        <TextArea layoutX="465" layoutY="503" minHeight="55" minWidth="450" prefHeight="56" prefWidth="450" id="textAreaMessage" promptText="Notifications" />
    </AnchorPane>While I was doing it SceneBuilder kept up popping up a number of error messages when it couldn't load it. Useful error messages were the ones which told you that you were missing an import (an autofix feature on the missing import might be a nice to have thing - I seem to recall NetBeans saying they might add extra editing features for fxml which included that). Another useful error message was when the line number of the error was reported, then at least the error could be localized. When the column number was reported with the line number it was usually the last column in the line and not the column index of the specific attribute in error, so that was less useful. Some of the error messages which were generated included fxml attribute info and that wasn't all that clear. Only one error message at a time was reported, rather than all errors in the file leading to a few fix edit and reload cycles. The automatic reloading in SceneBuilder of the file edited in NetBeans made these reload cycles pretty instantaneous which was nice.
    The most useless error spat out by SceneBuilder was the following:
    Error loading file 'C:\dev\javafx\JavaFXSamples\src\SceneTest_1.fxml'.
    C:\dev\javafx\JavaFXSamples\src\SceneTest_1.fxml:0: error:
         java.lang.ArrayIndexOutOfBoundsException: -1The above was reported because i placed an xml comment at the end of an otherwise perfectly good fxml file . . . who would have thought . . .

  • Poblem with FXML to load image in jar using: Image url="@/myImage.png"/

    If my FXML und image files are in a JAR-file then I have the Exception:
    Caused by: java.lang.IllegalArgumentException: URL must not be empty
    at javafx.scene.image.Image.validateUrl(Image.java:966)
    at javafx.scene.image.Image.<init>(Image.java:611)
    at com.sun.javafx.fxml.builder.JavaFXImageBuilder.build(JavaFXImageBuilder.java:27)
    My FXML file:
    <Button>
    <graphic>
    <ImageView>
    <image>
    <Image url="@/images/Printer_48.png" />
    </image>
    </ImageView>
    </graphic>
    </Button>
    Is there a Problem with the JavaFXImageBuilder which can't not load Images in JAR files?

    In jars it is case-sensitive:
    <Image url="@/images/myImage.png"/>
    is not the same as
    <Image url="@/images/myImage.PNG"/>
    Edited by: 961538 on Sep 27, 2012 4:03 AM

  • New MVC with Standard Tags and DB sample

    I have posted initial build of a new learning application on
              SourceForge "basicPortal" under CVS
              http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/basicportal
              It is using Struts with Standard Tags and X: Transform from DB, Realm
              base security, CURD, etc. etc. I have big plans for this, to be 20% of
              code that gets used 80% of time and "faces" and expression language
              compliant.
              (Err.. this build is not for newbies, but I will update it .... a lot
              and often.)
              To keep up on this and related topics, there is a mail list
              http://www.netbean.net/mailman/listinfo/mvc-programmers
              that also gets you password to other baseBeans.com features.
              and a newsgroups readers news.baseBeans.com.
              Hope you like,
              Vic C.
              

    Looking at the XFILES.5.xml file and Install.vbs files of the XFILES installer, it appears that the XDBPM_SUPPORT and XFILES_DBA_TASKS actions will only be run if you enter a SYSDBA user in the "DBA User" field of the installer. However, for some reason, Oracle seems to have commented out the command that checks to ensure that the DBA user you entered is a SYSDBA user, and the "DBA User" field defaults to SYSTEM, which is not a SYSDBA user. Since I got things working I haven't tried rerunning the installer with a SYSDBA user, but maybe it will work better. The installation documentation and/or the installation scripts need to be updated to reflect the need for a SYSDBA user.
    Regarding the APEX version of XFILES, this has not installation instructions whatsoever, and there are prerequisite steps to get this to install correctly as well. I tried importing the f102.sql file into APEX and it failed on the prereq validation because an "XFILES/Apex" folder wasn't found in XML DB. I went looking for anything that creates this directory and I found that there is another XFILES_DBA_TASKS.sql script specifically for the APEX version. It is included in the f102.sql file. So I cut and paste the contents into SQL*Plus and ran it as SYS. I was then able to install the f102 application.

  • MVC with Struts?

    If you are going to implement the MVC pattern in a webapp, what is the best framework to use?
    I've done a tutorial with Struts. Is that a good framework?
    Is there any disadvantages by using such frameworks?

    If you are going to implement the MVC pattern in a
    webapp, what is the best framework to use? None if you can do without it. The best solution is always the simplest. But you'd have to provide some requirements to get a better answer. Let me just say I've seen many projects that simply read/write small amounts of data from the database and display it on a web page, yet the architect will throw in struts, hibernate, etc. and almost all of the time (IMO) it's overkill.
    I've done a tutorial with Struts. Is that a good
    framework?Some people love it. Some people hate it. IMO it has many, many problems and I don't care for it one bit. However, it's very popular and lots of people use it, so it's not a bad skillset to have.
    Is there any disadvantages by using such frameworks?There are tons of disadvantages:
    1. The API is external (i.e. out of your control) so when it breaks you can't do anything but hack the source.
    2. Performance can be a problem, since you've got an extra layer of software to run through, but usually isn't. Struts for example isn't going to bog you down.
    3. It costs time (i.e. $$$) to train and come up to speed on how to use these frameworks. If you already know Java and have a small project you could likely complete it in the time it'd take you to learn struts.
    4. Compatibility. When the latest version of struts comes out for example, you might want to upgrade to get the latest features, but you might find it breaks the old API and now you have to fix a bunch of code because it's not backwards compatible. That's probably rare, but it's happened to me more than once with struts.
    5. Struts documentation (IMO) is horrible (maybe it's better today? i haven't used it in awhile) and it's not fun to learn.
    6. Struts error messages are ridiculous and it's often very difficult to figure out what went wrong. Whereas in core Java I find the error messages to be very helpful in telling me what I did wrong.
    The list goes on and on and on. Frameworks are bad news for many projects and then again they are saviors for others.

  • Implementing MVC with menus

    Hi, I'm trying to implement a menu bar with menus and submenus, all of which contain only basic JMenuItems (i.e., no checkboxes, radiobuttons, etc.). The twist here is I'd like to use MVC (Model-View-Controller), where there is a "menu model" to handle updates, similar to JTree with an underlying TreeModel.
    May I know if someone has already implemented this before, or know of a framework for this? I've googled using the keywords menu, jmenubar and model, but without any luck...
    Thanks in advance.

    Thanks, I'll have a good read over that later.
    I notice that Java has a lot of pre-defined interfaces and abstract classes for things I'd usually go ahead and write myself in other languages. To avoid wasting time re-inventing the wheel which of the commonly used patterns below already provide the necessary interfaces? :)
    * Singleton (yuck -- I avoid this where I can)
    * Registry
    * Observer (I know this does)
    * MVC
    * Prototype
    * Strategy
    * Data Mapper
    * DI
    A bit out of scope for this thread I guess.

  • Mvc with oracle entity framework

    Hi,
    I am new to both MVC and Oracle EF...i have installed the necessary components (ODAC beta 3) and tried out the tutorial that oracle has put up and was able to successfully finish it...
    Now i want to create a new MVC 3 app (based on MVC Movie tutorial available online) ...
    I have a model generated from my oracle database..however when i add a controller in MVC, the controller does not seem to recognize my model..What do i need to do so that controller can recognize the model that i generated from oracle database..????
    Is there an example out there that builds an asp.net MVC app using oracle entity framework??
    Thanks.

    Hello,
    is a week that I document but I still have a bit of confusion.
    Work on Oracle 11g with VS2010 I installed ODTwithODAC112030.
    I have to make a data entry form after the registration of an account.
    Can I create an application with MVC and EntityFramework then using Razor for pages CSHTML?.
    WHAT HAVE I DONE:
    1) Creating the Oracle schema QUESTIONARIO.
    2) Execution of InstallAllOracleASPNETProviders.sql
    3) Create application with MVC 3
    4) Insert the web.config connection parameters
    <connectionStrings>
        <add name="OraQuestConnString" connectionString="DATA SOURCE=...;....;USER ID=QUESTIONARIO;PASSWORD=*****" providerName="Oracle.DataAccess.Client" />
    5) Insertion of the parameters in the web.config for the management of user profiles
    <membership defaultProvider="OracleMembershipProvider">
    <profile>
            <providers>
              <clear />
              <add name="OracleProfileProvider" type="Oracle.Web.Profile.OracleProfileProvider, Oracle.Web, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraQuestConnString" applicationName="questionario_casa_ufficio" />
            </ Providers>
          </ Profile>
          <roleManager enabled="true" defaultProvider="OracleRoleProvider"> .......
    6) The application works and I registered users ORA_ASPNET_USERS etc..
    7) I have created the table "Questionnaire" in the DB
    8) I have created the Model of table "Questionnaire"
    9) I created the corresponding Controller and the Views pages with Razor who created in the "Views/Questionnaire" directory all management pages (Index.cshtml - Create.cshtml - Edit.cshtml - Delete.cshtml)
    10) when the application starts tells me I can not open the databasel SQL-Server, I suppose that it work only with SQL Server!! Or did I do something wrong?
    11) Then I create the Model from DATABASE using "ADO. NET Entity Data Model"
    12) But I did not understand if I can use the EDMX Model to create pages with Razor or with another tool.
    13) Is there an automated way to create pages of data management starting from the Model EMDX or do I have to create them all manually?
    Please help me.
    Thank you very much

  • BSP MVC with multiple components approaches

    Hello,
    I have developed in BSP with follows MVC. The BSP application had multiple subcontroller and one main controller. I had one model for each controller,
    but the models were "stored" on the level of the main
    controller.
    Is this the right way? Are there are other approaches?
    Regards & Thanks,
    Guido

    Hi,
    Do you mean to say that u have instantiated the subcontroller models in the main controller using the model data and assigning them to the views in ur subcontroller do_request method?If so it will work however a better approach is to instantiate one main model class (make different method in the model class to access the records from database)in the main controller and use it to assign to the view in the do_request method of the subcontroller.
    Hope this helps.
    Reward useful answers.
    Regards,
    Shrita.

  • MVC with JTable

    I have a question which actually came up from a discussion in [t-5391820] , but I felt that it goes too much away from the original question in that thread, which is why I'm opening this one.
    In the aforementioned thread I posted how I use JTables:
    I write a class that contains the information that should be displayed in the Table (for example a phone book with names and phone numbers), and then write a custom TableModel that will fetch the information from that phone book class when getValueAt etc. is called.
    public class PhoneBook    // the phone book
           private Vector<Contact> contacts;           // the phone book entries
            // constructor omitted
           public Contact getContact(int index)
                   return contacts.get(index);
           public void addContact(Contact newContact)    // method to add a contact the the encapsulated vector of contacts
                   this.contacts.add(newContact);
    public class Contact     // the contacts in the phone book
           // constructor and member variables omitted
           public getName()
                   return this.name
           public getNumber()
                   return this.number
    public class PhoneBookTableModel     // the custom table model
    extends AbstractTableModel
           private PhoneBook phonebook;
           // constructor and some methodes omitted
           public Object getValueAt(int rowIndex, int columnIndex)                      // the method actually obtains the information from the PhoneBook because the
           {                                                                                                     // tableModel doesn't store the information itself
                   if(columnIndex == 1)
                            return this.phoneBook.getContact(rowIndex).getName();
                   else if(columnIndex == 2)
                            return this.phoneBook.getContact(rowIndex).getNumber();
    }Now, there might be a button that adds a new contact. In its actionListener I would do something like this:
    phoneBook.addNewContact(new Contact());           // add the contact to the phone book
    ((PhoneBookTableModel)phoneTable.getModel()).fireTableChanged();-> When the phone book is modified I call the fireTableChanged method on the Table's TableModel, so that it knows that its contents have changed.
    camickr indicated that this is bad style, and that I should learn how MVC works. Now I have read some articles on MVC and I get the feeling that this is exactly what I am doing. The address book is the Model the JTable is the View and whatever interface allows modification of the adress book is the Controller.
    Could anyone explain to me where my way of thinking goes wrong? Note that the code provided in this post is just meant to clarify what I mean, I haven't actually compiled it...
    Thank you very much in advance

    jduprez wrote:
    Hello,
    I share your reluctance. I'm worried that a (mostly business-specific) model would have to know about the GUI-specific interfaces.
    Thanks :-)
    I thought about 3 ways to connect a swing GUI to a business model; having the model implement TableModel is just one of them. Your current approach is more along the lines of having a SwingModel as a wrapper of the business model (which requires to manually implement a notification mechanism in the business model).
    Your original approach looked like a controller class knew that the view requires an update after the business model had changed. That is actually MVC, in the sense Web developers understand it. Swing's MVC is rather different though (merely relies on the model notifying the view)
    Long ago I opened a thread to discuss all 3 approaches (yes, again one of these abstract discussions without an SSSCCCE, sorry about that): [here is a link to this old discussion|http://forums.sun.com/thread.jspa?forumID=425&threadID=784716].
    Very interesting, this makes everything a bit clearer in my head!
    That being said, you have to ackowledge that approach one (the business mdoel just implements Swing's TableModel) is faster to write, and probably just as well if not more mainainable. And the drawback of tying the model to Swing's TableModel interface are not so much:
    - the Swing Model interfaces are relatively unintrusive (they do not impose any signature such as an the "addrow" method, only for querying methods.
    - changing the view technology (e.g. switching from Swing to SWT or whatever) is relatively unfrequent.
    - if the data is inherently tabular, changing the model is rather unlikely (e.g. the same business model will likely not change from a TableModel to a TreeModel). Changing the widget may be desired at some point (say use grids of nested Panels instead of a JTable), but in this case the TableModel interface still make sense, and may be used to populate such custom panels.Acknowledged :)
    After these clarifications, I gave it another try on Approach 1 as you called it in your thread. I think now I really got it like it's meant to be, and I think for time being I can live with the drawbacks. Maybe I'll still try out the notifier approach though, just for curiosity. Because frankly speaking, I didn't really have a proper version of that approach, as camickr correctly said, I left the responsibility to call the fire methods to the developer, which is surely not so elegant...
    Thank you all for giving your input, it was really helpful!

  • Save changes in app MVC with Entity Framework

    Hi.
    I have a problem with my app, initially my app worked correctly and later send this error:
    System.Data.Entity.Infrastructure.DbUpdateConcurrencyException' occurred in EntityFramework.dll but was not handled in user code
    Additional information: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.
    please helpme.
    it´s so important.
    thanks.

    Hi krloz.hdz,
    -->System.Data.Entity.Infrastructure.DbUpdateConcurrencyException' occurred in EntityFramework.dll but was not handled in user code
    this error offen occurs at the SaveChanges(). I suggest you change the state of the entity like below before savechanges().
    db.overlayData.Attach(overlaydb1);
    db.ObjectStateManager.ChangeObjectState(overlaydb1, EntityState.Modified);
    db.SaveChanges();
    If you still have questions, you could share your code with us, we could help you better.
    Regards,
    Youjun Tang
    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.

  • Developing MVC, with ADF, problem saving to oracle database

    Following this tutorial
    http://www.oracle.com/technology/obe/obe_as_1012/j2ee/develop/endtoend/newADFto
    J
    SP/defaultendtoend.htm, I'm developing an application MVC, I create a jsp, for
    show my datas, in this jsp I have a Button in order to creta a new record and
    alaso have a button to make commit. When click create button, it take me to a
    new jsp where you can put the data for new record. When click submit my record
    has been created but when I tried to create a new record, the application just
    update the record that I Created, and the rest of button like next, previous,
    commit, just stop working. Also when I tried to make a commit, it take me to
    the jsp of create a new record.

    LD,
    You don't need to set the CLASSPATH environment variable.
    Personally, I prefer not setting CLASSPATH at all and using the "-classpath" option to the "java" command.
    You only need to include the JDBC driver.
    Your command should be:
    java -classpath C:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar test
    Your error message states that class "java.sql.Savepoint" is not found.
    I see the following in your CLASSPATH:
    C:\Program Files\Oracle\jre\1.1.8\bin
    I'm guessing you're probably running java version 1.1
    Class "Savepoint" was introduced in java 1.4
    Try the following command:
    (Again, I recommend unsetting CLASSPATH first.)
    java -version
    If it doesn't say you're running java 1.4 then that explains the cause of your error message.
    Also, I suggest visiting this Web page:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
    One of the links on that page is to the OTN forum on JDBC.
    That forum contains an announcement that class "oracle.jdbc.driver.OracleDriver" is deprecated.
    Here is the link:
    http://forums.oracle.com/forums/ann.jspa?annID=201
    The first URL I posted above has links to sample code as well.
    It's not a good idea to do connect to the database as the SYSTEM user if you aren't intending to do administration work.
    That's why Oracle supplies the sample SCOTT schema.
    The login and password is usually "scott/tiger".
    Story goes that the guy who developed the SCOTT schema is indeed called Scott and Tiger is the name of his cat. (Whatever ;-)
    Good Luck,
    Avi.

  • MVC with stock market type game

    Hi there all,
    I have a game that is based on the stock market only that the stocks are soccer teams. I've managed to download the team prices and then save it to a database. I'm now looking at displaying this info as various views, a JList that will display the team and its current price and then a graph with the price over a set period such as day or week. I've created the Model to be a Team. Each team has a name and price attribute. The name is set is the instantiation and the price can be set using a setPrice method. Once the setPrice method is updated this triggers the observers(list and graph). Unfortunately I'm not quite sure how to tie the views to the observer because I have many teams that I want to add to the list. My other problem arrises that the I'm not sure how to implement a controller for updating the team information. The controller for the list will be non visible as it is updated whenever I retrieve the price information off the Internet but this is handeled by another class. Any one with some suggestions??

    Would need to know what system you have (S20,D20,D30?).  I'm assuming you've done the homework to ensure your aftermarket PSU is working correctly and powerful enough to support the AMD card you're running.
    With the AMD card installed, what is the first thing you see when the system boots?  Is it the windows splash screen?  If you start hitting F1 as soon as the keyboard light comes on, are you able to get into BIOS?  It could be a matter of the display you're using not responding fast enough, or there could be something else going on in BIOS.  Hard to say since we've not really looked at that card at all.

  • Using MVC with Applet inside Servlet

    Hello fellow Java developers,
    I want to implement the Model View Controller concept inside a Bean Applet combination running in a servlet environment.
    When my model (the Bean) changes, I want my Applet (the View) to get notified so it can get the update from the Bean. The Applet is incorporated inside the jsp page (e.g. the servlet). The Bean is known inside the jsp. How do I make that same Bean known inside the Applet?
    When I create a new Bean during init, or in the constructor of the Applet, I get a complete other reference than the Bean inside the jsp. So, when I ask information from the Bean, I often get NullPointerExceptions, because I am referencing the wrong Bean.
    Does anyone have a solution for my problem?
    Regards,
    Michel

    hi,
    a servlet is server side object, an applet is client side object.
    For the communication, you should try HttpUrlConnection from applet to servlet.
    another way is tu use ejb, or rmi communcation

  • Cross Domain error for Silverlight + MVC application with self hosted WCF service on azure

    Hi,
    We are migrating existing Silverlight application to MVC; existing Silverlight application is hosted on
    Azure which is consuming self-hosted WCF service. For authentication we have implemented
    ADFS with WIF (passive). The cloud service (<myWebSite>.cloudapp.net) is C Name to (<myWebSite>.<myDomain>.com) and we 
    are consuming  WCF service at <myWebSite>.cloudapp.net/<myService>.svc, as we were getting “Cross Domain” error so we have added “clientaccesspolicy.xml” at the root of “WEB ROLE”.
    Existing Silverlight application works fine but the problem occurred when we deploy our migrated application to the same cloud service. We are getting a “Cross Domain” error.
    The same migrated application works fine on UAT environment, the only difference is UAT environment is
    without ADFS WIF implementation.
    Migrated application is half Silverlight and half MVC with initial landing page is Silverlight. MVC web role is used to host the service i.e. .SVC . To go to SL landing page , redirected from home controller. Following is being observed in fiddler for this
    application
    Existing Silverlight application -
    After authentication with ADFS it redirect to Silverlight landing page.
    Before calling service method it looks for “clientaccesspolicy.xml”
    In response header we are getting the content of “clientaccesspolicy.xml”
    And after this everything works fine
    Migrated Silverlight-MVC application –
    After authentication with ADFS it redirects to “HomeController” and from there we are redirecting to Silverlight landing page.
    Before calling service method it looks for “clientaccesspolicy.xml”
    In response header we are getting  following content - “https://federation-sts.<myDomain>.com/adfs/ls/?wa=wsignin1.0&amp;
    wtrealm=https%3a%2f%2f<myWebSite>.<myDomain>.com&amp;
    wctx=rm%3d0%26id%3dpassive%26ru%3d%252fclientaccesspolicy.xml&amp;wct=2014-03-17T10%3a36%3a04Z”
    4.Throw “Cross Domain” error.
    Also we have added filter in
    RouteConfig
    for .xml file
    routes.IgnoreRoute("{*allxml}",
    new { allxml = @".*\.xml(/.*)?" });
    NOTE: There is no configuration change apart from MVC configuration.
    We have done RDP to web role and found that “clientaccesspiolicy.xml” is present at “E:\approot” location and it is also accessible at “https://<myWebSite>.<myDomain>.com/clientaccesspolicy.xml”.
    Please help
    Thanks,
    Rahul P

    Hi,
    Please try to configure the cross domain policy file to allow public read access (that is, access it without federation requirement), make sure you can access the address
    http://something/clientaccesspiolicy.xml directly in a browser
    without redirecting to check whether the cross domain policy file could be anonymous accessed (Please start a new browser session and make sure you're
    not logged in. Then test the cross domain policy file.).
    Best Regards,
    Ming Xu
    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.

  • BSP with MVC

    Hi
    Can any one send me the document that will help to understand the architecture of MVC with examples.
    Regards
    Amit
    [email protected]

    Hi,
    For MVC, all the details can be found on the SAP Help page...
    The link is <a href="http://help.sap.com/saphelp_nw04/helpdata/en/0f/ab3a3c9ca75402e10000000a114084/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/0f/ab3a3c9ca75402e10000000a114084/frameset.htm</a>
    Hope this helps.
    Also for a specific issue, you can refer to SDN..
    <b><i>Do reward each useful answer..!</i></b>
    Thanks,
    Tatvagna.

Maybe you are looking for