Wednesday, December 30, 2009

Produktnøkkel Flying Simulator X Deluxe

Struts 2 actions in Struts 2 interceptors in struts.xml



in Struts 2 interceptors are procedures that run
before or after an action is invoked, there are some
defined we can use directly or create new and
implement these two schemes that have served us
to better understand the famous interceptor of Struts2.

But who better than an example to better understand this concept
.

we will develop a program that spends a
word of a page to another and the time of the change request page
of us display a message that runs automatically
by an interceptor. 1 .- Primiero

we create our home page, as always
page


index.jsp \u0026lt;% @ page contentType = "text / html"%>
\u0026lt;% @ page pageEncoding = "UTF -8 "%>

\u0026lt;% @ taglib uri =" / struts-tags "prefix =" s "%>

\u0026lt;! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN"
"http://www.w3.org/TR/html4/loose.dtd">

\u0026lt;html>

\u0026lt;head> ;
\u0026lt;meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">

\u0026lt;title> Struts2 \u0026lt;/ title>

\u0026lt;/ head>


\u0026lt;body>
\u0026lt;h1> pass the following word \u0026lt;/ h1>

\u0026lt;s:form action="proceso">

name="palabra" \u0026lt;s:textfield label="palabra"/>

\u0026lt;s:submit/>

\u0026lt;/ s: form>

\u0026lt;/ body>

\u0026lt;/ html> ;


2 .- create the following classes import

com.opensymphony.xwork2.ActionSupport;

public class Parameter extends

ActionSupport {private String word;

/ / @ Override public String execute
()
{System.out.println ("entered axecute");
return SUCCESS;}


getPalabra public String ()
{return word;
} public void

setPalabra (String word) {
this.palabra = word;

}} --------------------

-----------------------
this class is the interceptor, as
key things we can say that implements Interceptor
interface and method invoke () is which defines the processes
us before or after the action.

com.opensymphony.xwork2.ActionInvocation import, import
com.opensymphony.xwork2.interceptor.Interceptor;
PruebaInterceptor
public class implements Interceptor {public String intercept

(ActionInvocation next) throws Exception {


Next.invoke String s = ();
System.out.println ("intercept");

return s;}


public void init () {}

public void destroy () {}


}
if we put the System.out.println ("intercept"); before
next.invoke String s = (); will show the message before
System.out.println ("entered axecute") found in parameter class


3 .- create the page response, which is associated to the action
parameter.


\u0026lt;% @ page contentType = "text / html"%>
\u0026lt;% @ page pageEncoding = "UTF-8"%>

\u0026lt;% @ taglib uri = "/ struts-tags" prefix = "s"%>
\u0026lt;html>
\u0026lt;body>

\u0026lt;s:property value="palabra"/>
parameter
\u0026lt;/ body>
\u0026lt;/ html>

4 .- now we would be the most important thing strust.xml
our archive, which has our
configuration.


\u0026lt;!
DOCTYPE struts PUBLIC "- / / Apache Software Foundation / / DTD Struts Configuration 2.0 / / EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

<!-- Configuration for the default package. -->
<package name="default" extends="struts-default">

<interceptors>
<interceptor name="tiempo_servidor" class="PruebaInterceptor"/>

</interceptors>

<action name="proceso" class="parametro">

<interceptor-ref name="tiempo_servidor"/>
<interceptor-ref name="defaultStack" /> \u0026lt;result

name="success"> / resultado.jsp \u0026lt;/ result>
\u0026lt;/ action>

\u0026lt;/ package>
\u0026lt;/ struts>

of this code we can say that it is important this
interceptor-ref name = "defaultStack" in our action, since
that if the parameter is not word does not come to our website now

respuesta.jsp
when running our code, we
appreciate that at a glance we can see that
the parameter is passed from one page to another, but if we
our console can see that shows what next.

axecute entered


intercept try to make good an example as simple to understand and start
knowledge of this framework, I think
we recommend you read a lot and try to understand how it works
to avoid being stuck in
configuration problems, notably in the file
struts.xml

Tuesday, December 29, 2009

Mulberry Outlet York Review



Struts2 uses a configuration file called
struts.xml this xml file is used to start
project resources. That can be interceptors,
actions, results and others can also define global variables
, validations few bone
words is like the heart of our project.

can work with more xml files, but all
must be included in the file struts.xml
as follows include file (in the form of tag),
separate this file I think it's smaller
recommended when we are present a very large project
, because then we would be more orderly and easier
working, you could say we made a
modularization of our file.

file in practice I always put it in src
is not necessary to have it stored in web-inf folder
we must keep in mind that the structure our
struts.xml must respect the rules of a
xml format, since it will be transformed to (DTD
well formed xml file is as a validator of our
xml file and serves to cover it) to read, my cup
experience I have noticed that many errors are generated by forming
bad or wrong with this famous definition file,
have to note that reading this file
is sequential.

strustdefault.xml there is also the file and struts-plugin.xml
, these two files are included implicitly
(a resemblance to the Object class) and
have the default configuration and are loaded at startup
, in practice I can that are not
in our project, I work with netbeans and eclipce
times, but very little

seeing the structure of this file can see that their main
is tag, bone and within the root
others find it as

this package defines the working group, its
tag is
we share attributes or use of organizational form, a condition is mandatory
its name and its characteristics is that


may extend along with some major labels, we can find the tag
bean, these are created
by the framework and used and finally we discuss
constants (constant), this
are very useful as they can be used to define
settings, you can define what type of bean
to use, etc. As data we can say that
web.xml
initialization parameters are loaded as
FilterDispatchir constant. This is the famous FilterDispatcher
input of our project and is set in web.xml


to work with the constants must be
devmode = true, well this you can see from the
thousands of examples that can be
found in internet, but you know to which this
configuration.

as always I will leave good link, to enter in detail
strust2 more about, because we can find many examples
but if we do not understand what we always give
flying blind

link: Struts2 very good this link and this in English, well
explains the architecture of this framework and with only
next picture we can understand many things in this framework.

Saturday, December 26, 2009

Brazilian Frontier Wikipedia

Beginning with struts 2

I hope to give several examples of this framework, and we need to add comenezar
Struts2 our
netbeans and understand how it works.

the official link is Struts2

but not even pretend to explain this framework because there are many blog and web
explain, but in this article intend
to the starting point to begin working with this framework. 1.-

found this blog that explains how to start so good here


2 .- As always we must begin with the famous "hello world
" hehehe here is the link (the idea is not write and more than
same ADVANTAGE best there is.)

3 .- and finally this link explaining various labels link



Friday, December 25, 2009

Wart Removal Walk In Clinic Toronto

second example of jquery with jsp


the following example using jsp with jdbc, style sheet, it's going
text capture, save and rescue, to show in sequence after
down

insert.jsp


\u0026lt; % @ page contentType = "text / html"%>

\u0026lt;% @ page pageEncoding = "UTF-8"%>

\u0026lt;% @ page language = "java" import = "java.sql .* "errorPage =" "%> \u0026lt;script type="text/javascript" src="js/jquery-1.3.1.js">



\u0026lt;/ script>

\u0026lt;link rel="stylesheet" href="code.css" type="text/css" media="all" />

<script type="text/javascript" >

$(function() {

$(".update_button").click(function() {

var boxval = $("#content").val();

var dataString = 'content='+ boxval;

if(boxval=='')
{
alert("introduzca texto");

}else

{
$.ajax({

type: "POST",
url: "demo.jsp",
data: dataString,
cache: false,
success: function(html){

$("ol#update").prepend(html);
$("ol#update li:first").slideDown("slow");
$("#content").value('');
$("#content").focus(); $("#flash").hide();
}
});

} return false;
});
});

</script>
<div>
<form method="post" name="form" action="">
<h3>ingrese Comuna</h3>
<textarea cols="30" rows="2" name="content" id="content" maxlength="145" >
</textarea><br />
<input type="submit" value="Ingresar" name="submit" class="update_button"/>
</form>
</div>
<div id="flash"></div>
<ol id="update" class="timeline">
</ol>

demo.jsp


<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page language="java" import="java.sql.*" errorPage="" %>
<%

String content = request.getParameter ("content");

try {Class.forName ("org.postgresql.Driver");
Connection con =

DriverManager.getConnection ("jdbc: postgresql: / / localhost / example "," postgres "," 1234 ");
Statement st = con.createStatement ();
int i = st.executeUpdate
(" insert into communes (name) values \u200b\u200b('"+ content +"')"); ResultSet rs =

st.executeQuery
("select * from order by name desc commune");

if (rs.next ()) {

while (rs.next ()) {

String msg = rs . getString ("name");
%>
\u0026lt;li> \u0026lt;div>

\u0026lt;span> \u0026lt;% = msg%> \u0026lt;/ span>
\u0026lt;/ div>
\u0026lt;/ li>
\u0026lt;%

}}

else {out.println ("error");}}

catch (Exception e) {

Exception ex = e;
out.println ("Error connecting to postgres:" + ex);}

%>

data base is a simple table called commune
with a field called name and nothing else.

now create the style sheet in netbeans
we can create new web ,
cascading style sheet.


root {display: block;}


* {margin: 0; padding: 0;}
ol.timeline
{list-style: none; font-size: 0.8em;}


ol.timeline
li {display: none; position: relative;
padding: .7 em 0 .6 em 0;
border-bottom: 1px dashed # 000;
line-height: 0.8em;
background-color: # D3E7F5;
height:

ol.timeline 25px} li: first-child {
border-top: 1px dashed # 000;}


intersante found these examples very well and are self

filled with a text link with java
to enter more in detail we have this other link ,
also this example which is a dependent combo with jsp and ajax
and last link to get more link jQuery indetail



Patty Cake Vapirew Set

org.apache.commons

this is a very interesting library and can help us greatly in our development
to use this library
must download the appropriate jar, which you can find
here

this library provides us with management assistance String,
numbers, date.

lower after jar
add it to our project and we are ready to use.

on the following link can find more details about this library

Numéro Série Néro 3.1

transmission of data through ajax with jquery jquery

we will develop the following example
unlike the previous example is that now you can work with
file structures, and we will work with
a driver for our example. but let the sample.

1 .- First we will create our class book, encapsulated
like god, solomante the get the attributes of the class
because we SETI using a constructor.


public class Book {private String title;
private String type;
private int qty;
private String comment;

book () {}


Book (String title, String type, int qty, String comment) {

this.titulo = title;
this.tipo = type;
this.qty = qty;
this.comentario = comment;}



getTitulo public String () {
return title;}


getTipo public String () {return type
;
} public int

getQty ( )
{return qty;}


getComments public String () {return
comment;
}}




2 .- as a second step we create class books, which we manage objects
class book.

import java.util .*;


{public class

books Map books = new LinkedHashMap ();
public
books () {

books.put (11, new book (
"Java Swing "," java ", 1," for desktop applications "));
books.put (27, new book (
" php "," daniel ", 1," book to start php "

)
)

} public
book fetch (int id) {return books.get (id);}
fetchIds public Set () {return books.keySet ();}}


3 .-
after we create our archive of
getbook_as_table.js type and add the following javascript.

$ (function () {
$ ("# button"). Click (function () {$
. Ajax ({
type: "GET", url
"book_table.jsp"
data: {id $ ("# sel"). val ()},
success: function (data) {
$ ("# out"). html (data)

}})
})}
)

4. - now let's create the jsp pages, the first will
getbook_as_table.jsp


\u0026lt;% @ page contentType = "text / html"%>

\u0026lt;% @ page pageEncoding = "UTF-8"%>

\u0026lt;! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN"

"http://www.w3.org/TR/html4/ loose.dtd ">

\u0026lt;% @ page import =" java.util .* "%>

\u0026lt;% @ page import =" model .* "%>

\u0026lt;JSP: useBean id = "book" scope = "session" class = "modelo.libros" />

\u0026lt;html>

\u0026lt;head>

\u0026lt;meta http-equi = "Content-Type" content = "text / html; charset = UTF-8 ">

\u0026lt;title> selection de libro </title>

<script type="text/javascript" src="js/jquery-1.3.1.js"></script>

<script type="text/javascript" src="js/errors.js"></script>

<script type="text/javascript" src="js/getbook_as_table.js"></script>

</head>

<body>

<h3>Buscar libro</h3>

<select id="sel">

<% for (Integer i: books.fetchIds ()) {%>

\u0026lt;option value ="\u0026lt;%= i% %>">\u0026lt;%= i> \u0026lt;/ option>

\u0026lt; ;%}%>

\u0026lt;/ select>

\u0026lt;button id="button"> Search Book \u0026lt;/ button>

\u0026lt;br /> \u0026lt;br />

Book Selection :

\u0026lt;div id="out"> \u0026lt;/ div>

\u0026lt;/ body>

\u0026lt;/ html>

and last page

book_table.jsp
\u0026lt;% @ page contentType = "text / html"%>

\u0026lt;% @ page pageEncoding = "UTF-8"%>

\u0026lt; ,% @ page import = "model .*"%>

\u0026lt;jsp:useBean id="libros" scope="session" class="modelo.libros"/>

\u0026lt;% String id

= request.getParameter ("id") int

id_num = Integer.parseInt (id);

libros.fetch
Book book = (id_num)

book.getComentario comment = String ();

String title = book.getTitulo ();

book.getTipo type = String ();
book.getQty
int qty = ();

%>

\u0026lt;table border = "1" cellpadding = "5" >

\u0026lt;tr>

\u0026lt;td> Title: \u0026lt;/ td> \u0026lt;% = title%> \u0026lt;/ td>

\u0026lt;/ tr>

\u0026lt;tr> ;

\u0026lt;td> type: \u0026lt;/ td> \u0026lt;% = type%> \u0026lt;/ td>

\u0026lt;/ tr>

\u0026lt;tr>

\u0026lt;td> qty: \u0026lt;/ td> \u0026lt;td \u0026lt;% = qty%> \u0026lt;/ td>

\u0026lt;/ tr>

\u0026lt;tr>

\u0026lt;td> comment: \u0026lt;/ td> \u0026lt;td \u0026lt;% = comment%> \u0026lt;/ td>

\u0026lt;/ tr>

\u0026lt;/ table>

on the code, if you do not understand how it works useBean pu eden
find this blok as you work. Here

Thursday, December 24, 2009

Full Katesplayground Sets

Sample selection based on a combobox with jquery

in the preceding article only explains an introduction,
but really what matters is the implementation
is it that we give some examples
found it very interesting to begin to understand better what is jquery
and how to work with her.

we must first have our project with the
js folder in which we find jquery-1.3.1.js this
what we see in the preceding article.

in the same folder create a file to work with javascript
that we do so:



client_getperson create the file and within
introduce the following code:

$ (function () {
$ ("# button") . click (function () {
$ ("# out"). html ($ ("# sel"). val ())}
)
})



parckage souce then create the package model,
where we

People class package model;

public class People {private String

people []
= new String [] {"Joe", "Felipe", "hector", "enzo" "sergio", };
public int getNumPeople() { return people.length; }
public String getPerson(int num) { return people[num]; }
}

ahora en nuestra pagina jsp


<%@page contentType="text/html"%>

<%@page pageEncoding="UTF-8"%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="java.util.*" %>

<%@ page import="modelo.People" %>

\u0026lt;jsp:useBean id="people" scope="request" class="modelo.People"/>

\u0026lt;html>

\u0026lt;head>

\u0026lt;meta http-equiv = "Content-Type" content = "text / html; charset = UTF-8">

\u0026lt;title> Selection with javascript \u0026lt;/ title>

\u0026lt;script type = "text / javascript" src = "js / jquery-1.3.1.js "> \u0026lt;/ script> \u0026lt;script type="text/javascript"

src="js/client_getperson.js"> \u0026lt;/ script>

\u0026lt;/ head>

\u0026lt;body>

\u0026lt;h3> Seleccion Persona \u0026lt;/ h3>

\u0026lt;select id="sel">

\u0026lt;% for (int i = 0; i \u0026lt;people.getNumPeople (); + + i) {%>

\u0026lt;option value ="\u0026lt;%= people.getPerson (i )%>">\u0026lt;%= i%> \u0026lt; ; / option>

\u0026lt;%}%>

\u0026lt;/ select>

\u0026lt;button id="button"> View person \u0026lt;/ button>

\u0026lt;br /> \u0026lt;br />

Selected Person: \u0026lt;span id="out"> \u0026lt;/ span>

\u0026lt;/ body>

\u0026lt; / html>

and so we are left out:

well this is the simplest example, but it otherwise is so
more complete.


\u0026lt;% @ page import = "java.util .*"%>

\u0026lt;% @ page import = "modelo.People"%>

\u0026lt;jsp: useBean id="people" scope="request" class="modelo.People"/>



<html>

  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>Selection con ajax</title>

    <script type="text/javascript" src="js/jquery-1.3.1.js"></script> \u0026lt;script Type="text/javascript"

src="js/server_getperson.js"> \u0026lt;/ script>

\u0026lt;/ head>

\u0026lt;body>

\u0026lt;h3> AJAX "Get Person" \u0026lt;/ h3>



\u0026lt;select id="sel">

& # 160; \u0026lt;% for (int i = 0; i \u0026lt;people.getNumPeople (); + + i) {%>

\u0026lt;option value ="\u0026lt;%= i% %>">\u0026lt;%= i> \u0026lt;/ option>

& # 160; \u0026lt;%}%>

\u0026lt;/ select>

\u0026lt;button id="button"> search person \u0026lt;/ button>

\u0026lt;br /> \u0026lt;br />

& # 160; person Selected: \u0026lt;span id="out"> \u0026lt;/ span>

\u0026lt;/ body>

\u0026lt;/ html>


on file vestments server_getperson.js type:

$ (function () {
$ ("# button"). click (function () {$
. ajax ({
type: "GET" / / The default
url: "GetPerson"
data: {id: $ ("# sel"). Val ()},
success: function (data) {
$ ("# out"). Html (data )

}})

then we have a servlet called GetPerson

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
modelo.People import;
GetPerson
public class extends HttpServlet {private

People people = new People ();


protected void processRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException
,
IOException {response.setContentType ("text / html; charset = UTF-8");
PrintWriter out = response.getWriter ();
try {

String id = request.getParameter ("id");
out.print (people.getPerson (Integer.parseInt (id)));


} finally {out.close ();}

/ /. ....
}

Wednesday, December 23, 2009

Pokemon Frigo Return Rom

jsp


jQuery is a javascript library that is being using far
one of the features of this library is its well
compressed version shares many characteristics of prototype
(one difference is the method call).

explained in a previous link some ajax and if there is any doubt
would be good to see this topic, plus I have a link for further
over the issue.

http://ungranoparajava.blogspot.com/2009/05/empezando-con-ajax.html

ajax understand if we already have or want to go directly to what we view this practice
jquery manual very good (in
official website there is much documentation and even in English)

http://www.librosweb.es/ajax/capitulo10/la_libreria_jquery.html

in the above link can also find a manual
ajax prototype and is very good about this link.

now let that bring us together lol, what fun it is to
code.

as always we will use our
netbeans and the first thing we do is a web project, which does not include any
framework (such as hibernate, jsf, struts, etc.
but can be used with jsf, struts, spring etc.) .

as we see our project has a js folder, create it in this
new-> other-> carperta. To work with this library
have to download the file jquery-1.3.1.js, this is
version but we can work with the former being the well 1.2.1
are many. This file is saved in the folder you created in
js our project is so simple.

and now work as one does with javascript, but we must define our jquery
in the code.


\u0026lt;% @ page contentType = "text / html"%>

\u0026lt;% @ page pageEncoding = "UTF-8"%>

\u0026lt;! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN "

" http://www.w3.org/TR/html4/loose.dtd ">

\u0026lt;html>

\u0026lt;head>

\u0026lt;script src="js/jquery-1.3.1.js"> \u0026lt;/ script> \u0026lt;script type="text/javascript">



$ (document). ready (function () {

alert ("loaded");}

);

\u0026lt;/ script>

\u0026lt;meta http-equi = "Content-Type" content = "text / html; charset = UTF-8 ">

\u0026lt;title> JSP Page \u0026lt;/ title>

\u0026lt;/ head>

\u0026lt;BODY>

\u0026lt;h1> JSP Page \u0026lt;/ h1>


can see in the above code
a small example of how to implement the jQuery library in netbeans

The following link
can see what we can accomplish with this library;
good examples

Now let's take a link from this example that's great, the idea is to communicate
jquery jsp and. date only because I found this link
very good example to begin and the idea is not to copy but reusing code
jejejej the idea is to give a hand to COMUDES java.

http://rekkeb.wordpress.com/2009/03/15/comunicar-jsp-y-jquery/

as the topic is interesting I think we will create another entry on the subject, with more interesting examples.




Tuesday, November 24, 2009

Full Kates Playground Sets

call a jsp ejb from Struts 1.x and Struts 2.x

java call an ejb from a servlet is extremely easy and is a
of the facilities that we provide the ejb version 3, but since it is a jsp
the same because you have to call by
JNDI (as is not complicated)

first let's create our ejb.


package ejb;
import
javax.ejb.Remote;


@ Remote public interface {saludoRemote

public String greet ();}




------------------------------------ package ejb;
import
javax.ejb.Stateless;

@ Stateless (name = "saludoRemote") public class
saludoBean implements

saludoRemote {public String greet () {return

hello from ejb "}



} so we have the draft

now go to our web project



only good from a servlet to call by
have the option of right click insert code-> call
enterprise bean and select our ejb and we generate the following code

@ EJB private
saludoRemote saludoBean;

saves the @ EJB jndi use, this call has
also be outside of any method of the servlet class.

another observation that I found on the web is different in the implementation
and JBoss glassfish server at the time of lookup
take on different servers.

eg for jboss

Context context = new InitialContext ();
HelloWorld helloWorld = (HelloWorld) Context.lookup ( "HelloWorldBean / remote" )

example: for glassfish

Context context = new InitialContext ();
HelloWorld helloWorld = (HelloWorld) Context.lookup ( HelloWorld.class.getName () )

Thursday, November 19, 2009

Expired Ativan Effects



the changes we can find between these two versions
are very important, as first impression
can say it is not the same. The main differences are
:


Servlet Unit:

Struts 1 Actions have dependencies on the servlet
(HttpServletRequest and HttpServletResponse)
these objects are passed to the method of execution in Struts 2, "Actions are not
container dependent because they are made simple POJOs.
In Struts 2, servlet contexts are represented as simple maps
, also
actions can access the original request
. Acction
class


It solved the problem of abstract classes in Struts 2, Struts 1
the kind of action needs to expand the framework since
depends on the abstract base class.
But in the case of Struts 2, Action
class can implement interfaces
For Struts 2, Actions are not container dependent
because they are made simple POJOs.

Struts 2 provides a basis for implementing class ActionSupport common interface.
While the Action interface is not necessary.
Any POJO object with an execution of the signature can be used as a
Struts 2 Action object.

Validation

The two versions can do manual validation in Struts 1
using the method of the ActionForm, or validates through an extension
the Commons Validator.
However, Struts 2,
It utuliza the XWork validation framework.
The
Xwork validation framework supports chaining validation.


Threading Model

In Struts 1, action resources must be thread-safe or synchronized.
What actions are unique and multi-threaded,
The Singleton design pattern
imposes
where Struts 2, objects are instantiated
action for each application, so no thread (This creates less impact)




Testability Struts 1 Testing applications are a bit complex , but Struts 2
Actions can be tested.



entry collection
Struts 1 uses an ActionForm object to capture input. ActionForms
And all you need to extend a framework dependent base class
.
JavaBeans can not be used as
ActionForms, so developers have to create redundant classes to capture
input. However
Struts 2 uses Action properties (as input properties independent
underlying structure)
eliminating the need for an object, thus reducing the redundancy
.

addition, Struts 2, the action properties
can be accessed from the website via the taglibs.
Struts 2 also supports
ActionForm pattern, as well as POJO form objects and POJO Actions.



good there are more differences but I believe that these are the most important
, then when I drive over and find another
modificare missing these points.

How To Make Yogurt Starter



To start developing in Struts, we must first start with
basic concepts.

1 .- first let's create our project in netbeans

In this last window we find the following:

Action Servlet name: Here are
deployment descriptor web.xml , contains a entry for the servlet and specifies
Struts action and its specific parameters,
as the path to the servlet class in the library and
Struts struts-config.xml configuration . Action

Url Pattern: Specifies
patterns
input applications that are mapped to controller actions Struts


Aplication Resource: Specifies
packages will be used for struts-config.xml


struts TLDs Add: Allows you to generate
descriptors tag library,
A tag library descriptor
is an XML document that contains additional information.


good now generated the project are the following:


here we can see that we struts.xml config-file, this file
is where we will save your configurations, with a
xml format, here We confgurar the action-mappings, form-beans and much
more.

This configuration file is the coordinator of our project.

we can also see the file: ApplicationResource.propierties,
this file we will save properties that will be called
mediente the implementation of our project, eg

errors.usuario = The user variable entered does not match.

more files there are good and we can see, but only
're starting.

Another very important process in the development of our project is to create ActionFormbeans
and Action
these we can find it here:


To end and to better understand this framework, we can see in the following figure
as is the behavior of our
future project.

Tuesday, October 13, 2009

Cost Of Iceland Honeymoon

Project Struts in Netbeans JPA better understand the J2EE library management

Well before the JPA example in netbeans
showed a very simple example of using this library, but it is necessary to better understand
enter the library, since in reality
we will not face simple examples.

found this video to share, plus other interesting link
the subject.




and also a good link to enter more in detail.

http://www.javadabbadoo.org/cursos/infosintesis.net/javaee/implementarJPA/consultarUsuariosVWJSF/index.html
http://www.javaguicodexample.com/javavisualwebdatabaseappdev.html
http://schuchert.wikispaces.com/JPA+Tutorial+1+-+Getting+Started
http://java.pragmasoftware.com.mx/wikijava/en/Special:History?topicVersionId=100&topic=Java_Persistance_API
http://www.roseindia.net/software-tutorials/detail/24071
http://www.oracle.com/technology/products/ias/toplink/jpa/examples/jsf-jpa-example.html
http://www.netbeans.org/kb/60/web/jsf-jpa-crud-part1.html
http://java.sun.com/javaee/5/docs/tutorial/doc/bnbpz.html
http://luchorondon.blogspot.com/2009/04/jpa-java-persistence-api.html

a link to work in eclipse
http://wiki.eclipse.org/EclipseLink/Examples / JPA

also exists the concept of relationship between entities

http://es.debugmodeon.com/articulo/relaciones-en-jpa
http://www.roseindia.net/jpa/eclipsejpaexamples / jparelationship / index.shtml

Monday, October 5, 2009

Yonex Nanospeed 9900 Canada

table in jsf with hibernate hibernate

this example is very simple, we will fill
a table with netbeans visual web of data
a database table.

first have to generate a configuration
with jsf hibernate (which can be seen in http://ungranoparajava.blogspot.com/2009/10/jsp-con-framework-hibernate.html ) and also have to add
as the visual web framework.


here we must bear in mind that deal Query
not SQLQuery, because we have HQL ocuapar corresponding to
first mentioned, because we are working with objects.


after the init method to add the method call
mostrarEmpresa ()


@ Override public void init () {

super.init ();


try {_init ();
} catch (Exception e) {
log ("SessionBean1 Initialization Failure", e) throw e instanceof
FacesException? (FacesException) e: new FacesException (e);}


mostrarEmpresa ();}


Business class is found here, which is the representation


then look for the property table table layout

Friday, October 2, 2009

Toy Story Portable Dvd Player

Part 2

In the previous example we saw how to configure a jsp project Framewor
and Hibernate, but we need to see how to save (insert)
in the database, this process is very simple and we will make
as follows:

in class: consulta_empresa company created a method to keep public String

guardar_empresa (Empresa em) {try {



org.hibernate.Transaction session.beginTransaction tx = ();
Session.save (em);

tx.commit () ;
return "Company saved"

} catch (Exception e) {
e.printStackTrace ();}



return "Error";

}}

the method returns the type that we can leave as
more we accommodate us, but we spent importate an object type that this company
seti its parameters with the set that has
this object already created and that is the representation of the table
database.

consulta_empresa class has the following.

Session session = null;
public
consulta_empresa () {
this.session = NewHibernateUtil.getSessionFactory (). GetCurrentSession ();}

newHibernateUtil
and is the class we created earlier
(to understand it is necessary to see previous article)

this is the code I have in a jsp page to call the method guardar_empresa
.
<% if(request.getParameter("guardar")!=null){ out.println("nombre: "+request.getParameter("nombre")); Empresa e=new Empresa(); e.setNombre(""+request.getParameter("nombre")); e.setDireccion(""+request.getParameter("direccion")); e.setRut(""+request.getParameter("rut")); consulta_empresa co=new consulta_empresa(); String respuesta; respuesta=co.guardar_empresa(e); out.println("br "); out.println("center "+respuesta+" /center"); } %>

As next step is to better understand the language that has
Hibernate HQL.

http://www.java2s.com/Code/Java/Hibernate/CatalogHibernate.htm

http://www.acsinet-solutions.com/es/tutoriales/hibernate/01-mapeo_sencillo.html

Basic Configuration Mapping Single with Spring Framework:

http : / / www.acsinet-solutions.com/es/tutoriales/hibernate/02-mapeo_sencillo.html

Thursday, October 1, 2009

Edward Jones Investments How They Make Money



java Hibernate is a tool that performs the mapping between
oriented world object-world applications and
entity-relationship databases in Java environments. The term used is
ORM (object / relational mapping) and technology is making the transition
a representation of the data in a relational model
an object-oriented model and vice versa. Hibernate

not only does this this transformation but provides capabilities for collecting and storing data from the database that we reduce development time.

the structure of this framework we can see in an article in my blog:

Http://ungranoparajava.blogspot.com/2009/06/arquitectura-de-la-persistencia.html

we will see a small example of this framework with jsp and as always with Netbeans IDE

1 .- create our web project

2 .- assign the name, next and select the hibernate framework and also the basis of data that we will work

2.1-based data have to be registered, as we see in Figure

3 .- add these Two configurations are shown in the hibernate.cfg.xml file

the configuration can be seen in xml format, this is where the settings are saved
the framework.

4 .- let's create the objects related to the data base we select

5 .- now generate the hbm.xml of each table is related to an object of type beans

5.1 Although we have the draft

6 .- generate the kind newhibernateUtil

7 .- generate a class: consulta_empresa, which consists of a constructor and method which provides a Query (obs : hibernate HQL to query occupies)

8 .- Now go to our index and insert this code very simple

for more information https: / / www.hibernate. org /