What is Shine Enterprise Java Pattern ?
how know what is Shine Enterprise Java Pattern and its benefits ?
any tutorial or e-book will be very useful too.
don't miss sample code
Software
how know what is Shine Enterprise Java Pattern and its benefits ?
any tutorial or e-book will be very useful too.
don't miss sample code
by mcgrow
The Java Web Model Service architecture is based on MVC.It improves all disadvantages ,and add some adavantages points to it.As Struts comes to help us to implement our project based on MVC , we need maplet to implement JWMS architecture.These maplets are based on those old Servlets ,with some new featurs.
Purpose of JWMS architecture is that, to have a JSP page for every job of your actors in UML diagrams. And those all actions start from a request JSP page ,and continue with one or more maplets ,and then finish with a response JSP page (for all possibles response ) through a flow just like your UML diagrams.
Now there isn't any need to make a JSP page for every possible response (for example a proper response for empty fields and an other proper respose for errors ...) like before.Instead, the all things you need is that to create a response jsp page and tag it.A tag for success message a tag for error and so on.
As you see , every thing is very simple.Also, you can be a project manager too !!!
An other ability of maplet is that ,you don't need to carry parameters with yourself by using session or application.Maplet gets all parameters from the first page and cross it to an other maplet or JSP.For reaching these parameters you just need to define a public String variable as the same name of parameter in first JSP page.The content of this variable is the same as user inputted parameter(with out doing any job!).
We are not magicians , we just know how to work with URL !!!
If you want to send any parameter to next maplet ,add it to URL as the same !!!
For more information and knowing how to work with AddURL(),forward(),... read the complete document from below link :
that two 'IT Department Managers' both in 'tehran' (with lower-case 't'), both interested in the same software, would join on the same day?
For messages that originated in Iran, there's a lot of pork in them.
by j2os
(file) maplet.tld
///////////////////
1.0
1.1
maplet
Service
org.j2os.shine.maplet.tag.Service
JSP
name
SecureService
org.j2os.shine.maplet.tag.SecureService
JSP
name
ErrorService
org.j2os.shine.maplet.tag.ErrorService
JSP
////////////////////////
request page
(file) AddEmail.jsp
////////////////////////
<%@ page contentType="text/html;charset=windows-1252"%>
untitled
Add a new Email to my email list
///////////////////
request page
(file) SearchEmail.jsp
/////////////////////////
<%@ page contentType="text/html;charset=windows-1252"%>
untitled
Search an email in my list
/////////////////////////
request page
(file) AddPhoneNumber.jsp
////////////////////////////
<%@ page contentType="text/html;charset=windows-1252"%>
untitled
Add a new phone to my phone book
////////////////////
request page
(file) SearchPhoneNumber.jsp
////////////////////////////
<%@ page contentType="text/html;charset=windows-1252"%>
untitled
Search a phone number in my phone book
////////////////
response page
(file) EmailServiceResponses.jsp
//////////////////////////////////////
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="/WEB-INF/maplet.tld" prefix="maplet"%>
Your email address had entered successfully.
name:
<%=request.getParameter("name")%>
email:
<%=request.getParameter("email")%>
<%=request.getParameter("name")%>'s email : <%=request.getParameter("email")%>
your email address failed! there was a problem!
you had entered a wrong value!
No Access!
///////////////////////////////////////////////////////////
response page
(file) PhoneServiceResponses.jsp
/////////////////////////////////////
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="/WEB-INF/maplet.tld" prefix="maplet"%>
Your phone number had entered successfully.
name:
<%=request.getParameter("name")%>
phone:
<%=request.getParameter("ph_num")%>
<%=request.getParameter("name")%>'s phone : <%=request.getParameter("ph_num")%>
your number failed! there was a problem!
you had entered a wrong value!
No Access!
///////////////////////////////////
engine page (maplet)
(file) Controller.java
/////////////////////////////////
package Model;
import org.j2os.shine.maplet.*;
import org.j2os.shine.jconnection.JDBC;
import java.sql.*;
public class Controller extends Maplet {
public String name;
public String email;
public String ph_num;
private String forward_tag,forward_page;
JDBC db=new JDBC();
public void initialize() throws Exception{
db.login("com.mysql.jdbc.Driver","jdbc:mysql://localhost/j2os", "Username", "pass", true);
}
public void addEmail() throws Exception {
boolean a=db.executeSQLQuery("insert into email_table (name,email) values ('"+name+"','"+email+"')");
forward_page="../service/EmailServiceResponses.jsp";
if (a) {
forward_tag = "add_success";
} else {
forward_tag = "add_error";
}
}
public void searchEmail() throws Exception {
ResultSet r = db.getSQLQueryContent("select email from email_table where name like '"+name+"'");
while (r.next()) {
email= r.getString("email");
}
addURL("email",email);
forward_page="../service/EmailServiceResponses.jsp";
if (!(email.equals(""))) {
forward_tag = "search_success";
} else {
forward_tag = "search_error";
}
}
public void addPhoneNumber() throws Exception {
boolean a=db.executeSQLQuery("insert into phon_table (name,phone) values ('"+name+"','"+ph_num+"')");
forward_page="../service/PhoneServiceResponses.jsp";
if (a) {
forward_tag = "add_success";
} else {
forward_tag = "add_error";
}
}
public void searchPhoneNumber() throws Exception {
ResultSet r = db.getSQLQueryContent("select phone from phone_table where name like '"+name+"'");
while (r.next())
{
ph_num= r.getString("phone");
}
addURL("ph_num",ph_num);
forward_page="../service/PhoneServiceResponses.jsp";
if (!(ph_num.equals("")))
{
forward_tag = "search_success";
} else {
forward_tag = "search_error";
}
}
public void rater() throws Exception {
db.commit();
forward(forward_page, forward_tag);
}
}
//////////////////////////////////////////////////////
by gsg
I think they'll take you to Shinola land.
The PTB's need to remove this whole thread.
by mattina
I found a sample for jshooter! check it! I dont know if it works true or no!
jsp pages:
----------------index.jsp---------------
<%@ page contentType="text/html;charset=windows-1256"%>
untitled
-------------callMethod.jsp--------------
<%@ page contentType="text/html;charset=windows-1256"%>
untitled
call one of methods:
----------------response.jsp----------------
<%@ page import="java.util.ArrayList"%>
<%@ taglib uri="/WEB-INF/maplet.tld" prefix="maplet"%>
untitled
<%
String a=request.getParameter("methods");
String[] b=a.split("&");
for(int i=0;i");
}
%>
output of <%=request.getParameter("method_name")%> method:
<%=request.getParameter("return_value")%>
No Access
Classes:
client package:
---------------caller.java------------
<%@ page import="java.util.ArrayList"%>
<%@ taglib uri="/WEB-INF/maplet.tld" prefix="maplet"%>
untitled
<%
String a=request.getParameter("methods");
String[] b=a.split("&");
for(int i=0;i");
}
%>
output of <%=request.getParameter("method_name")%> method:
<%=request.getParameter("return_value")%>
No Access
server package:
--------------Distributer.java----
package server;
import org.j2os.shine.jshooter.*;
public class Distributer {
public static void main(String[] arg) throws Exception {
Application app = new Application();
app.distribute(1099, "firstApp");
}
}
-------------SourceClass.java----
package server;
public class SourceClass
{
public String helloWorld() {
return "Hello World!";
}
public String byeEverybody() {
return "bye bye!";
}
}
This discussion is closed to new replies.
Sort by Trending