How to use a  MVC architecture

i dont know how to use a MVC architecture,what are the files has to be needed to create a MVC architecture,right now iam using jsp file and a java file .in jsp file i just use the usebean tag

http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html

Similar Messages

  • How to use Spring MVC instead of assembler.jsp in endeca 3.1.0

    Hi ,
    I am new to Endeca . I want to use spring MVC instead of assembler.jsp .Some body please help
    me how can i do it. Wht all i have to do to achieve it.
    Thanks
    Mark

    Hi Mark,
    When using the 3.1 Assembler in your application, you can use either the jar file directly or set up the Assembler as an HTTP service and process the XML or JSON responses. Neither of these approaches conflicts with using Spring in your application.
    Sean

  • What are the uses of MVC, Extension and how to create it for begineers pls

    what are the uses of MVC, Extension and how to create it for begineers pls
    dont give link for tutorials please explain ,
    thank you,
    Regards,
    Jagrut BahratKumar Shukla

    Hi,
    Check out this link :
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/0f/ab3a3c9ca75402e10000000a114084/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/0f/ab3a3c9ca75402e10000000a114084/content.htm</a>
    It is the best possible explanation and documentation that you'll get.
    Thanks,
    Tatvagna.

  • How to use MVC using MDM as backend... in Webdynpro for java

    Hi,
       How to use MVC using MDM as backend.. when we r using R/3 we used to create RFC model. I dont know how to use it here..
    Regards,
    laxmi.

    Haii
    Create a data a source using ur ODBC tool. This can be found in Administrative tools of windows.
    In ur connectino class u can write the following code
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc.odbc.dsnname u have given when u created data source","user namet","pwd");( I think there is no need to give username when u connect to ur access)
    The connection "con" is ready to use.. Put these statements inside a try catch...
    I think i have explained enough..
    regards
    SHanu

  • How to use MVC in Swing application

    Hi,
    I'm creating an application using Java Swing. I want to use Model View Controller (MVC) architecture to design by application. I want to use MVC to seperate by business logic functionality from the control and presentation logic that uses this logic.
    I need your help to get this done successfully. Please send me a SAMPLE JAVA SWING APPLICATION where they have applied MVC, it will be helpful to me.
    Thank you,
    Regards
    kumar

    Would this be a basic example of an application that uses MVC?
    //MODEL
    public class Model {
         public void showMessage() {
              System.out.println("You clicked me!");
    //VIEW
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class View extends JPanel {
         private JButton buttonSave;
         public View() {
              super();
              initUI();
         public void initUI() {
              buttonSave = new JButton("Save");
              buttonSave.addActionListener(new Controller());
              add(buttonSave);
    //CONTROLLER
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class Controller implements ActionListener {
         private Model m;
         public Controller() {
              m = new Model();
         public void actionPerformed(ActionEvent e) {
              m.showMessage();
    }Is this a correct implementation of MVC? I am trying to learn it, and use it in an example.
    Thanks for your help/input.

  • MVC architecture - how it can be applied to swings

    hi
    I have created a program that gets data from an MS access database and displays it in Swings JFrame, with view, next, previous buttions to traverse through records
    I want to write my program in the MVC architecture model. Though i have read details about it, i am unable to apply it on new programs.
    Any one please help me with an instance of a program or modify the below program to suit the MVC architecture
    thank u
    import java.awt.*;
    import javax.swing.*;
    import java.sql.*;
    import java.awt.event.*;
    class display extends JFrame implements ActionListener
    ResultSet rs;
    Statement st;
    JTextField tf;
    JLabel l;
    Button b0,b1,b2;
    ResultSetMetaData rsmd;
    display()throws Exception
    tf = new JTextField(10);
    l = new JLabel("Empno: ");
    b2 = new Button("Previous");
    b1 = new Button("Next");
    b0 = new Button("View");
    connection con = new connection();
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    setSize(300,300);
    c.add(l);
    c.add(tf);
    c.add(b0);
    c.add(b1);
    c.add(b2);
    setVisible(true);
    l.setBounds(20, 10,70,35);
    tf.setBounds(20,50, 70,35);
    b0.setBounds(20,90, 70,35);
    b1.setBounds(90,90, 70,35);
    b2.setBounds(170,90, 70,35);
    b0.addActionListener(this);
    b1.addActionListener(this);
    b2.addActionListener(this);
    public void actionPerformed(ActionEvent ae)
    if(ae.getActionCommand().equals("View"))
    try{
    rs.close();
    rs = st.executeQuery("select * from emp");
    if(rs.next())
    tf.setText(rs.getString(1));
    catch(Exception e)
    {System.out.println(e);}
    if(ae.getActionCommand().equals("Next"))
    try
    if(rs.next())
    {tf.setText(rs.getString(1));b2.setEnabled(true);}
    else
    {b1.setEnabled(false);b2.setEnabled(true);}
    catch(Exception e)
    {System.out.println(e);}
    if(ae.getActionCommand().equals("Previous"))
    try
    if(rs.previous())
    { tf.setText(rs.getString(1)); b1.setEnabled(true);}
    else
    {b2.setEnabled(false);b1.setEnabled(true);}
    catch(Exception e)
    {System.out.println(e);}
    class connection
    connection()throws SQLException, ClassNotFoundException
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:dsn1");
         /*st = con.createStatement();
    rs = st.executeQuery("select * from emp");*/
    st = con.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    rs = st.executeQuery("select * from emp");
    } // connection constructor
    } // end of connection
    }//end of display
    class records
    public static void main(String args[])throws Exception
    display d = new display();
    }

    help full hint use code formating tags
    David

  • How to create a simple app using the MVC approach?

    Hello gurus i'm trying to learn the SAPUI5 and i'm trying to create a simple app using the MVC i created the app and trying to add a lable to the view but there is nothing appear when i run it the code for the HTML page
    <!DOCTYPE HTML>
    <html>
      <head>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
      <script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
      id="sap-ui-bootstrap"
      data-sap-ui-libs="sap.m"
      data-sap-ui-theme="sap_bluecrystal">
      </script>
      <!-- only load the mobile lib "sap.m" and the "sap_mvi" theme -->
      <script>
      sap.ui.localResources("mytestapp");
      var view = sap.ui.view({id:"idshell1", viewName:"mytestapp.shell", type:sap.ui.core.mvc.ViewType.JS});
      view.placeAt("content");
      </script>
      </head>
      <body class="sapUiBody" role="application">
      <div id="content"></div>
      </body>
    </html>
    the code for the view
    sap.ui.jsview("mytestapp.shell", {
      /** Specifies the Controller belonging to this View.
      * In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
      * @memberOf mytestapp.shell
      getControllerName : function() {
      return "mytestapp.shell";
      /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
      * Since the Controller is given to this method, its event handlers can be attached right away.
      * @memberOf mytestapp.shell
      createContent : function(oController) {
      var oLabel = new sap.ui.commons.Label("l1");
      oLabel.setText("Test label");
      oLabel.placeAt("content");
    i dont know what is wrong or if i should use a container to display my controls
    any help will be appreciated
    thanks in advance

    Hi,
    Instead of   oLabel.placeAt("content"); use return oLabel;
    so it will as below,
    createContent : function(oController) {
      var oLabel = new sap.ui.commons.Label("l1");
      oLabel.setText("Test label");
      return oLable;
    Regards,
    Chandra

  • How to use standard classes to create custom modulepool program like ME21N

    I am at the Starting Point of doing a classical dynpro program via Abap Objects which address all controls with MVC Architecture .So i debugged the standard ME21n transaction to find out how i can start with. I came across this interface which has no Attributes and Methods.I wondered y .Thats y i posted a Question .I also seen a lot of Standard classes
    CL_TABLE_VIEW_MM
    CL_BASIC_MODEL_VIEW_MM
    CL_COMPOSITE_SCREEN_VIEW_MM
    CL_SCREEN_VIEW_MM
    CL_TABLE_VIEW_MM
    CL_TABSTRIP_VIEW_MM
    CL_TC_BUTTON_VIEW_MM
    CL_TC_ITEM_VIEW_MM
    CL_TOGGLE_VIEW_MM
    CL_VALUE_MODEL_VIEW_MM
    and much more for Model and Controllers ..Can u plz guide me how i can make use of this classes effictively in my custom module pool programming

    I think all these classes serve the purpose of embracing the basic ones and are used specificalty in MM module.
    If you want to create similar module pool program with nice expand/collapse buttons in relation to subscreens please refer the some tips [here|expand/collapse button functionality on module pool screen;
    Also there are transactions like BIBS, DWDM which you can follow the examples from. I think SAP has covered all GUI controlls there so you can create really complex programs with various GUI controlls independently of module used for.
    Of course you can still stick to classes you mentioned but I think the better is to learn some standard approach of creating such screens, then if you feel more advanced go for using module specific ones if you really need that.
    Regards
    Marcin

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • Database access in a MVC architecture

    Hi!
    I'm a bit confused with regards to where the database access code should be put in a MVC architecture. From reading various articles and posts on this forum, there seem to be a lot of different opinions.
    Some seem to put the database access code in the controller servlet(or JSP), while some seem to use helper classes from the JavaBeans, while a few people even seem to access the database directly from the JavaBean.
    My questions is: What is the best place to put the database stuff in a MVC architecture? An explanation as to why a particular solution is the best would be great..
    Thanks!
    regards,
    Vidar

    Let's say I have a class called Department that contains methods like getName(), getId(), setName(), etc... The Department class is my business object. To save and load Departments from a database, I have a class called DepartmentManager. The DepartmentManager saves and loads the departments to the database, and has methods like saveDepartment(), saveDepartments(), loadDepartment(), getDepartments(), etc... In some cases, my manager classes also caches the results so they don't have to load from the database each time. Often times, the manager class is a singleton. My Department class has no idea how it is persisted, or that it is part of a cache. It just knows about itself. The DepartmentManager is resonsible for managing all the persistance and lookup functionality for Departments.
    Therefore, if I have a JSP page that needs to display Departments, my code might look like:
    DepartmentManager dm = DepartmentManager.getManager();
    ArrayList listDepartments = dm.getDepartmentList();
    for (int i = 0; listDepartments != null && i < listDepartments.size(); i++) {
         Department dept = (Department)listDepartments.get(i);
         out.println("<option value=\"" + dept.getId() + "\">" + dept.getName());
    }If I had a specific Department I needed, I would get it as follows:
    DepartmentManager dm = DepartmentManager.getManager();
    Department dept = dm.getDepartment(nId);

  • Which is more in line with MVC architecture with Struts?

    Hello all
    When using the MVC Model 2 architecture, the JSP's are the view, servlets the control, and the beans are the model. If we say that a control method should represent a specific use case, then in theory, you should be able to call the control method from any interface to request that a specific use case be performed, whether it be over a simple socket connection receiving bytes, or using HTTP.
    However, when using jsp's/servlets, if thr servlet is the control, then it means that the interface must make the request using HTTP and contain a request/response object. But supposing you wanted to change the interface to request the same use case, but makes an http request but supplying XML (instead of several request parameters) which contains the request data, you cannot then simply use the same servlet use-case.
    So what is the solution? If you write another servlet to handle the different request format (XML) it copies a lot of the control code from the other servlet which is a bit messy. Or, would it be correct to write a seperate Controller class (standard Java class), which would contain a set of related use cases, and are called by the servlet. Each use case (which would be a method call in the controller class), would take in its parameter list the exact type and data it needs to complete the use case. In this case the servlets are simply pulling data from the HttpRequest object, converting them to the correct java type to be passed to the controller class you create.
    This introduces an extra layer; the servlet now sits between the request interface and control. It means that the control methods can be called from any type of interface, but is it the right way of doing things, and how would the new control objects be held in the servlet?
    Please could someone give their opinion on which they think is the best way of architecting this?
    Many thanks,
    Shaun.

    Shaun,
    I'm going through the same issues as I try to build my own MVC framework. Struts is useful, but does not cover everything. If you're interested, I've found that the book "Core J2EE Patterns - Best Practices and Design Strategies" by Alur, Crupi and Malks is very helpful. It contains design patterns for all the various tiers. It does not describe a framework, just a set of patterns from which you can pick and choose.
    In the example you describe, one of the applicable patterns is the "Session Facade" which is basically a high-level business interface. The goal is to hide the complexity of the entire business API from the client. The book recommends each facade to correspond to a related set of use cases. e.g. methods in one facade could include OpenAccount, CloseAccount, GetBalance etc. Implementation would be Java classes.
    This facade should be independent of the request protocol and could be used for HTTP, by a Java application, by a web service etc. Usually the facade classes would be located close to the business objects to minimize network delay and traffic.
    In your example, the controller servlet (Struts Action) would invoke services from the Session Facade.
    You're right about this introducing an extra layer. Depending on your present and future needs, you can end up with others such as abstracting the persistence layer. The trade-off is between up-front effort and future flexibility.
    You ask how to reference the new objects. In my case, the initialization servlet calls a factory class method to get references to the facades. These references are stored in an application-specific object that is added as a ServletContext attribute for use by other controller servlets.
    I know this doesn't fully answer your question, but hopefully it helps a little.

  • Collections in MVC architecture

    My question concerns the use of collections of entities in a database-access MVC architecture. An example similar to my situation would be a Corporation, which (among other attributes) has a collection of Departments, which (among other attributes) has a collection of Projects, which (among other attributes) has a collection of Employees.
    Sometimes, I may want information such as all the Employees in the corporation, which would necessarily involve retrieving all the entities from the database. Other times, I may only want the employees in a certain Department, in which case I wouldn't want to waste the time population all the Department beans with Project and Employee information.
    Basically, I'm not sure how to best go about populating Javabeans that contain other Javabeans containing other Javabeans. Obviously, when I go to retrieve a Corporation bean, I don't always want all the Departments, Projects, and Employees. However, it seems like it would be using a lot of redundant code to have one factory that returns just the Department base information (without it's Employees), one factory that returns all the Departments and their Projects (but not the Employees), one factory that returns all the Employees for a given Project (but not ALL the Projects and their Employees), and so on.
    I've read plenty of MVC tutorials (and even taken a course in it), but I've never really seen a basic situation such as this addressed. What is the best way to go at this situation? Does anyone know of any tutorials/examples that are similar to this situation?

    First let's say your post reminded me my previouse Project where i faced exactly this topic.( not a problem may say ) :)
    That's it orr94 ! No MVC related topic, says about these. this may be referenced in your experience of Programming and System Design, with the knowledge of OOP, implementing DBs, Performance issues, and so on...
    Simply i can tell you, by my experience, try to feel ( and then find ) what your system is supposed to do? and how it does that?
    In a situation when you should give many reports, collecting your information, and the main part is GIVING THE LISTS OF REPORTS, just try to load all of your data. ( here first time spends much time, but after that no time is needed for DB operations. you every time read from your objects ( makin' them Updatable )
    But if number of the times you should gather this information, is such small that it dosn't actualy needed to read more than wanted.
    So see that there is NO GENERAL ANSWER to this question. ( i found it on that project, spending a month to find any answers. )
    YOU SHOULD FIND YOUR ANSWER. try feeling your system by real-time TESTS, that would make you sure about a solution.
    P.S. Now as a tip
    Create a Database Logic Bean which all related methods go in for CRUD operations on entities, then as friends said, try puttin some flags for reading entities ( e.g in your constructors which use DB bean methods )
    and then try different approaches readin the data, see which makes sense to your system.
    As the last point, what chintat said ( A Getter() which reads the from db that lists ) is not a good solution, where each call to that getter(), where it'd be many calles, attemps to access db!!! you should read once, then getter() returns a reference ( maybe readonly ) to that list.
    I think the question is when to read, where YOU SHOUD FIND THE ANSWER. ;)
    nice post, i hope it helps. ;)
    Behrad

  • Javabeans in MVC architecture

    Hi
    Building a web application based on MVC architecture. I am new at this so my implementation may not be correct. My Javabeans are representations of SQL DB tables. So, e.g. I have a Customer table in my SQL database, I would have a CustomerBean to represent this table.
    My problem is that Javabeans can only have empty constructors. So how can I get a single record from my customer table? Currently, I am using a method to get this record.
    E.g.
    CustomerBean customer = new CustomerBeanImpl();
    customer.setRecord(primaryKeyOfCustomerTable);
    In setRecord(int PK) method, I execute a SQL query to retrieve the record with that primary key and set all the instance variables for that object.
    I find that this method "not elegant".
    However, if I break the requirements of Javabeans, i.e to implement non-empty constructors, i.e.
    Customer customer1 = new Customer(primaryKey1);
    this would be better. In this case, my class is not a JavaBean anymore.

    Thanks. So, I conclude from your reply that Javabeans
    must have empty constructors. That's what I thought
    too. Until I was looking at an example from "Core
    servlets and JSPs" and came across an example where
    the class used (if anyone is interested, it is
    "TravelCustomer.class" in page 365 of the book) is not
    an Javabean per se, as it did not have a empty
    constructor but was used in the <jsp:useBean> tag like
    any other Javabean!
    That got me confused. Anyone care to explain this?As you know, <jsp:useBean> first checks whether a reference to the specified class exists as an attribute under the specifed id and scope.
    If the reference is found, then the scripting variable is set to that reference. If not found, then <jsp:useBean> checks whether the class can be instantiated and has a no-args constructor. If yes, an object of that class is instantiated (in Tomcat using Beans.instantiate) and the reference is stored as an attribute in the specified scope as well as in the scripting variable.
    In the "Core Servlets..." example, the TravelCustomer object is always instantiated in a servlet and its reference saved as a session attribute with id = "customer". The servlet then forwards to a JSP that includes:
    <jsp:useBean id="customer" class="coreservlets.TravelCustomer" scope="session" />Since the "customer" attribute is always present, the useBean never has to instantiate a TravelCustomer object and so the lack of a no-args constructor does not come into play.
    I'm not sure if this is good or bad practice, but that's why it works.

  • Using model 1 Architecture for inserting row into DB...

    The question is on the design of a JSP using Model 1 architecture.
    I have a html form with 3 fields taking input from user. I have made a java bean with 3 instance varibales in the name of the field names and with getter() setter() methods too.
    I dont want to hardcode the database access in the JSP. How do i acheive modularity or make use of object orientation concepts in the JSP to open aconnection and save the record into a database.
    I dont want the conventional way of harcoding like registering DriverManager... Creating Statement opject and OPening Connection...... and with Statement object to call executeUpdate() method...
    These all should be encapsulated in class and methods so that my JSP looks simple......
    Java Gurus, How do i get going.........

    Untill now, I have motsly written java web applications merely showing information; there's no insert or update available. nevertheless, the design pattern MVC or Model-View-Controller can work just as good for display-only web apps as for the rest.
    You're right if you don't want to have the database connection inside your JSP's. So how do you have to deal with it. The letters MVC already tell a part of the story. You have 3 kinds of objects :
    - Model : the so-called Java Beans; these objects refer to the concepts known to the usezr of the web app, like Client, Product, Order, Orderline, Invoice, Payment
    - View : these are the JSP's
    - Controller : this is the heart of the web app; Java uses the servlets to be the controller.
    But there's another kind of object you will need, namely the DAO or Data Access Object. These objects define the contact with the database, contain the SQL-statements and make objects of the Model type.
    I'll give 2 examples. The first is the GeneralDao which you define just once. This GeneralDao contains the database driver you're using.
    /** Java class "GeneralDao.java" generated from Poseidon for UML.
    * Poseidon for UML is developed by Gentleware.
    * Generated with velocity template engine.
    package org.gertcuppens.dao;
    // import java.util.*;
    import java.util.ResourceBundle;
    import java.sql.*;
    /* import org.apache.log4j */
    import org.apache.log4j.Logger;
    public abstract class GeneralDao {
    // operations
    * de GeneralDao is de algemene klasse waar alle andere DAO's of Data Access
    * Objects van erven. Het is de bedoeling om in deze klasse ��nmaal de
    * getConnection te defini�ren
    * <p>
    * getConnection() connecteert met de databank afhankelijk van de JDBC-driver
    * die voorhanden is. Deze methode zorgt ervoor dat alle afgeleide DAO's van
    * dezelfde driver gebruik maken terwijl er toch maar op ��n plaats de naam
    * van de driver gedefinieerd is.
    * </p>
         protected Connection getConnection()
              throws java.sql.SQLException
         Connection dbconn = null;     
         ResourceBundle resBundle;
         Logger mopoLogger = Logger.getLogger("mopo.log");               
         mopoLogger.debug("start connectie databank " );      
              try
              Class.forName("com.mysql.jdbc.Driver").newInstance();
              resBundle = ResourceBundle.getBundle("gcoConfig");
              mopoLogger.debug("ophalen resourceBundle (gcoConfig) " );
              String dbConnectie = resBundle.getString("databaseconnection");
              mopoLogger.debug("lezen databaseconnection in resourceBundle " );
              //dbconn = DriverManager.getConnection("jdbc:mysql://localhost/gco");
              dbconn = DriverManager.getConnection(dbConnectie);
              mopoLogger.debug("maken connectie databank " );
              } catch (InstantiationException e)
                   System.out.println("GeneralDao - Fout bij getConnection - instantiation " );
                   mopoLogger.fatal("GeneralDao - Fout bij getConnection - instantiation " );
                   e.printStackTrace();
              } catch (IllegalAccessException e)
                   System.out.println("GeneralDao - Fout bij getConnection - illegal acces " );
                   mopoLogger.fatal("GeneralDao - Fout bij getConnection - illegal acces " );
                   e.printStackTrace();
              } catch (ClassNotFoundException e)
                   System.out.println("GeneralDao - Fout bij getConnection - class not found " );
                   mopoLogger.fatal("GeneralDao - Fout bij getConnection - class not found " );
                   e.printStackTrace();
              return dbconn;
    } // end GeneralDao
    Each object of the Model type should have a corresponding DAO. In my webapp I had 3 kinds of model objects, so I've defined 3 DAO's. All these DAO's are children of the GeneralDao. I'll give an example of this.
    package org.gertcuppens.dao;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import org.gertcuppens.general.Gebruiker;
    /* import org.apache.log4j */
    import org.apache.log4j.Logger;
    public class GebruikerDao extends GeneralDao {
    * Zoekt de gebruiker op aan de hand van de opgegeven naam en wachtwoord
    * @return Gebruiker
    * @param _naam
    * @param _wachtwoord
    public Gebruiker findGebruiker(String naam, String wachtwoord)
    throws SQLException
         Logger mopoLogger = Logger.getLogger("mopo.log");               
         mopoLogger.debug("start findGebruiker" );      
    StringBuffer zoekString = new StringBuffer();
    zoekString.append ("select * from gebruiker ");
    zoekString.append("where naam=? and wachtwoord=? ");
         Connection con = getConnection();
    PreparedStatement ps = con.prepareStatement(zoekString.toString());
    ps.setString(1,_naam);
    ps.setString(2,_wachtwoord);
    ResultSet rs = ps.executeQuery();
    if (rs.next() )
    Gebruiker gebruiker = new Gebruiker(rs);
    rs.close();
    ps.close();
    con.close();
    mopoLogger.debug("gebruiker gevonden " + gebruiker.getNaam());
    return gebruiker;      
    else {
                   ps.close();
                   con.close();
                   mopoLogger.debug("geen gebruiker gevonden");
                   return null;
    } // end findGebruiker
    } // end GebruikerDao
    Want to know more about this ? Just give me a sign.

  • Re: [SunONE-JATO] Re: How to use a tiled view without a model

    I'm not sure what is different for you now. You still parse the string
    and put it into a data structure. Before the data structure was a
    vector, in JATO its just a model with a "hidden" data structure (a hash
    map).
    MVC only really comes into play when you talk about where your write
    this code, and where the data structure is being stored. So really, JATO
    takes care of half of the MVC'ness of it all (where the data is store).
    You just decide where to be the code to populate the model.
    Make sense?
    Is there something different required of you in JATO in this scenario
    that I am not grasping?
    c
    Hoskins, John D. wrote:
    Thanks for the feedback.
    The problem I was solving involved a single string, which contained
    delimited subsets of information.
    The string looked like
    this:"time|analyst|description|time|analyst|description|..."
    In ND, I parsed it apart into it's components (time vector, analyst vector,
    description vector), populated the repeated.
    With JATO, how would I make a model for something that doesn't have a
    database component like this?
    I'm pretty new to this MVC thing, so bear with me.
    John D. Hoskins
    Telephone & Data Systems
    Application Development & Support
    Voice: 608.664.8263
    Fax: 608.664.8288
    Email: john.hoskins@t...
    -----Original Message-----
    From: Craig V. Conover [mailto:<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039098031198039130252055210">craig.conover@s...</a>]
    Sent: 6/26/2002 3.22 PM
    Subject: Re: [SunONE-JATO] Re: How to use a tiled view without a model
    I guess the only thing "weird" (for lack of a better term) about what
    you are doing is that your are populating the model on the "display
    cycle". Typically, the cycle goes like this:
    Request -> populate model -> update data store -> retrieve data to
    populate model -> display data
    some of the above steps are optional but hopefully you get the point I
    am making.
    So what you are doing is:
    Request -> populate model/display data
    If it works for you, then it's not necessarilly wrong. But I would
    probably have my model populated before I forwarded to the target
    (displaying view bean) or at a minimum, in the begin display event of
    the view bean or the tiled view, but not during the iteration of the
    tiled view.
    c
    jhoskins wrote:
    Craig,
    Thanks for the pointers. I ended up doing something else. I set the
    models setSize() method to set the max size, and as the tiles fields
    iterated, populated the value from some vectors I had the data in
    already. Is this solution fraught with peril and will ultimately fail,
    or should I try your way?
    John
    --- Craig V. Conover wrote:
    John,
    Check out the docs for DefaultModel. There is an appendRow() method.
    So get your tiledview's primary model (the tiledview's primary model
    should be set to use an instance of DefaultModel), model.appendRow(),
    then model.setValue("fieldname", value) for each value.
    Rinse, repeat as needed.
    c
    jhoskins wrote:
    I would like to use a tiled view, but populate the fields manually.
    Any pointers about where I can set the size of the tiled view? I tried
    setMaxDisplayTiles() in the beginDisplay, but it won't get down and
    generate the rows.
    John Hoskins
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    Craig,
    Thanks for the pointers. I ended up doing something else. I set the
    models setSize() method to set the max size, and as the tiles fields
    iterated, populated the value from some vectors I had the data in
    already. Is this solution fraught with peril and will ultimately fail,
    or should I try your way?
    John
    --- "Craig V. Conover" wrote:
    John,
    Check out the docs for DefaultModel. There is an appendRow() method.
    So get your tiledview's primary model (the tiledview's primary model
    should be set to use an instance of DefaultModel), model.appendRow(),
    then model.setValue("fieldname", value) for each value.
    Rinse, repeat as needed.
    c
    jhoskins wrote:
    I would like to use a tiled view, but populate the fields manually.
    Any pointers about where I can set the size of the tiled view? I tried
    setMaxDisplayTiles() in the beginDisplay, but it won't get down and
    generate the rows.
    John Hoskins
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

Maybe you are looking for

  • SetMask works in movieclip but not in scene

    I am using the tutorial code: maskee.cacheAsBitmap = true; maskMC.cacheAsBitmap = true; maskee.setMask("maskMC"); and when I put the elements in a fla file by itself, or if I test the movie clip (not the entire scene) it works fine. But if I test the

  • Flex SDK & Flash Pro

    I don't program in Flex or Flash Builder. I tend to build my app interfaces as I go, So coding in flash professional seems the way to go. It seems to me that there are a lot of extra steps designing the interface, converting it to a flex component, a

  • E75 - Contacts. Problem with cache

    Hey there I've got my brand new E75 and I'm quit happy with it but there is a very strange problem. When I open the contactsmenu and try to search after some names it shows me the errormessage that the cache will be bbuild up soon. I should try it la

  • My iphone 3gs's screen is freeze with the apple logo, how can I fix it?

    I need a solution as soon as possible. I'm going to loose all the data?

  • Re: How to remove back from AE2420?

    Quote from: Yang on 24-June-15, 03:06:48 Please refer it on youtube as below link: Thank you for help. I pinpointed two useful tips from this video. Firstly, I don't have to be gentle with DVD-ROM cover, appe...