2013年10月31日星期四

Failed to connect to MySQL using JDBC


<%
String userName =
new String (request. getParameter ("userName"). getBytes ("ISO-8859-1"), "UTF-8");
String password =
new String (request. getParameter ("password"). getBytes ("ISO-8859-1"), "UTF-8");
Connection con = null;
Statement st = null;
ResultSet rs = null;
if (userName.equals (""))
{
response.sendRedirect ("login.jsp");
}
try {
Class.forName ("com.mysql.jdbc.Driver" ) ;
String url = "jdbc: mysql :/ / localhost: 3306/eims? useUnicode = true & characterEncoding = gbk ";
con = DriverManager.getConnection (url, "root" , " 6785098 " ) ;
st = con.createStatement ();
String query = "select * from user where userName = '"+ userName +"' ";
rs = st.executeQuery (query);
if (rs.next ())
{
String query2 = ; "select * from user where password = '" + password + "'";
rs = st . executeQuery (query2);
if (rs.next ( ) )
{
response.sendRedirect ("main / main.jsp");
} else {
response.sendRedirect ("login.jsp");
}
}
} catch (Exception e) {
e.printStackTrace ();
} finally {
rs.close ();
st.close ();
con.close ();
}
%>

So many workflows. With which good ?

Willow

detail can be developed by the Huihoo Power to its Chinese home page view. Willow
More information

OpenWFE

OpenWFE is an open source Java workflow engine . It is a complete business process management suite : an engine , a task list , a Web interface and a reactor ( storing automatic proxy ) . It can be good with your program to fit .
More information OpenWFE

jBpm

jBpm is a flexible and scalable workflow management system . Enter the runtime server as jBpm business processes using a simple but powerful language and packaged in process archives . jBmp workflow application development, convenience and excellent enterprise application integration (EAI) capabilities are combined . jBmp includes a Web application and a scheduler . jBmp is a set of J2SE components that can be deployed as a J2EE Application Clusters .
More information jBpm

OpenEbXML

OpenebXML project dedicated to providing an ebXML framework , soon to be the main support UN / CEFACT and OASIS ebXML specifications released version 2.0 .
More OpenEbXML information

Werkflow

Werkflow is a flexible and scalable processes and state -based workflow engine . Its goal is to meet all conceivable workflow from enterprise-level business processes to a small range of user interaction processes. By using pluggable and layered structure can easily accommodate a variety of workflow semantics.
More information Werkflow

OSWorkflow

OSWorkflow is a flexible workflow engine , designed to be embedded in enterprise applications. It offers many of the persistence API support includes : EJB, Hibernate, JDBC , and others. OSWorkflow can also be integrated with Spring .
More information OSWorkflow

wfmOpen

WfMOpen WfMC and OMG is the so-called workflow facility (workflow facility) ( workflow engine ) J2EE implementation . By extending the XPDL workflow description .
More wfmOpen information

OFBiz

OFBiz is a very famous open source project , based on the latest available J2EE/XML create norms and technical standards, to build medium-sized enterprise-level , cross-platform, cross-database , multi-layer cross-application server , distributed e-commerce WEB application systems framework. The main feature is the OFBiz OFBiz offers a complete development of Java-based web application components and tools . Including physical engine , service engine , messaging engines , workflow engines , rules engines.
More information OFBiz

ObjectWeb Bonita

Bonita is a line with WfMC specifications and flexible collaborative workflow system . For a variety of actions such as process modeling concepts , definitions , examples , process control, and user interaction to provide a fully integrated graphical tools . 100% browser-based , using SOAP and XML data binding technology of the Web Services encapsulate existing workflow business methods and publish them as Web Service J2EE-based form of release . Activity-based prediction model of the third generation workflow engine .
More information ObjectWeb Bonita

Bigbross Bossa

very fast , lightweight engine that uses a very expressive Petri net define workflows , does not require a relational database , simple to use , and Java applications can be integrated . In fact, it is designed to be embedded .
More information Bigbross Bossa

XFlow

XFlow run on EJB and servlet container .
More information XFlow

Taverna

Taverna project aims to provide a language and software tools to facilitate the use of workflow in the eScience and distributed computing technologies.
More information Taverna

Enhydra Shark

Shark solely based on WfMC and OMG using XPDL as its workflow definition language. Processes and activities of storage using Enhydra DODS ( an open-source OR mapping tool ) .
More information Enhydra Shark

PowerFolder

PowerFolder is an easy to use , easy to install J2EE-based workflow server , including the developers to use web-based studio.
More information PowerFolder

Open Business Engine

Open Business Engine is an open source Java workflow engine that supports WfMC specifications, including interfaces 1 (XPDL), Interface 2/3 (WAPI) and interface 5 . OBE for the active operation to provide a controlled, centralized environment . OBE is mainly based on J2EE implementations .
More information on Open Business Engine

OpenWFE

OpenWFE is an open source Java workflow engine . It includes scalable three components: engine , job listings and Web interface. Although it uses XML Process Definition Language format, inspired of Scheme, a Lisp dialect.
More information OpenWFE

Freefluo

Freefluo using the Web Service is a workflow collaboration tools that can handle WSDL of the Web Service calls. It supports two XML workflow languages ​​: IBM 's WSFL and XScufl. Freefluo very flexible and its core is not associated with any workflow language or execution architecture associated reusable collaborative framework . Freefluo including executable using a subset of WSFL described workflow runtime.
More information Freefluo

Twiste

Twister goal is to provide a new generation , easy integration, application Java latest achievements in the field of B2B oriented workflow solutions . BPEL-based business process workflow engine specification and Web Service standards.
More information Twiste

Con: cern

con: cern workflow engine based on an extended case (case) processing methods, process consists of a set of conditions before and after the activities have composed .
More Con: cern Information

JFlower

JFlower is a Java developer workflow engine that can be extended through the Java plug-in . Server can parse XML documents to perform tasks , checking conditions . Session data is stored in a database , so the server is fully scalable .
More JFlower information

JFolder

JFolder (formerly PowerFolder) is a workflow server and development environment , it can be configured in any J2EE server and database .
More JFolder information

JAWE

Java-based graphical workflow editor . Graphical workflow editor . Using JAVA language development, open source . Strictly follow WFMC specification. XPDL (XML Process Definition Language) WFMC an XML Process Description Language . Workflow definition file is saved in a local XML file
More information JAWE

Zebra

Zebra is a workflow engine. Originally designed to fill a commercial open source workflow engine blank . It has some different from other workflow system features:

* All workflow model can be described in the workflow patterns
* an easy to use GUI designer
* a persistence layer middleware
* OO design
* a Web application based Turbine Zebra
More information

ActiveBPEL

ActiveBPEL engine is a robust runtime environment , it can perform based on BPEL4WS or just BPEL1.1 with WS-BPEL2.0 specification written in business processes. ActiveBPEL
More information

YAWL

YAWL (Yet Another Workflow Language) an open-source workflow language / processing system which is based on existing workflow and workflow processing system of an accurate analysis of the language , unlike conventional systems , which provides most of the direct support of workflow patterns . YAWL supports the control flow perspective , and with PivotChart WSDL standard web services combined .
More information YAWL

MOBE

MidOffice BPEL Editor (MOBE) is an open-source platform that allows execution, monitoring , adjustment, end each defined process harmoniously combined. achieved using this platform to J2EE technology and common standards such as : BPEL, XML and SOAP.
More information MOBE

RUNA WFE

RUNA WFE is based on JBOSS-JBPM open-source workflow engine working platform which is a cross-platform for end-user business processes processing solutions easily with all SQL database management systems combined.
More information RUNA WFE

micro-workflow

micro-workflow framework applicable to those procedures to be separated in their control and logic aspects of developers, so the frame can make their processes independent of each other . It is a good code reuse and code integrity .
More information on micro-workflow

bexee

bexee is a BPEL execution engine and is an open source implementation of the BPEL standard .
More bexee information

PXE

PXE-Process eXecution Engine is a modular business process execution engine supports WS-BPEL2.0 or BPEL4WS1.1 specification describes the business processes.
More information
------ Solution -------------------------------- PXE ------------
project is now in use jbpm4.4
------ Solution ------------------ --------------------------
Xi always said " the shoes do not fit , pass through before we know ." They used to use . Like that to use that
------ Solution ----------------------------------- ---------
noon meal , so many restaurants, is also used to give practical advice do
------ Solution --------------- -----------------------------
jbpm I've used , better scalability !
------ Solution ---------------------------------------- ----
Men with their own writing ~ ~ ~
------ Solution ------------------------ --------------------
jbpm used , or more , to see personal habits
------ Solution ----- ---------------------------------------
jbpm4.4 I used , it was found his history of problems. Some methods are empty tables and the need for their completion. Other aspects of it is actually very easy to use .
------ Solution ---------------------------------------- ----
jbpm mostly ....
------ For reference only ------------------------- --------------
see most is jBpm
------ For reference only --------------- ------------------------



so much. I used to , but come . . . To the point of practical suggestions
------ For reference only --------------------------------- ------
. net domain we are using Microsoft's wwf, screenshots for everyone to enjoy , I think enough of all the functions . Supports concurrent streams flow circulating flow conditions , support for version control, has countersigned , processes reminders , monitoring, withdrew a series of functions



------ For reference only ---------------------------------- -----
I trust jpbm, our platform to use, highly scalable !
------ For reference only -------------------------------------- -
JBPM people now use a lot of, I added a exchange group devoted to this, and can give a lot of suggestions, I have a lot of problems can be solved in the above . Group number : 152654373
------ For reference only ---------------------------------- -----
  The reply deleted by an administrator at 2013-10-28 15:21:42

------ For reference only ---------------------------------- -----
Activiti why no one used it ? Who take this compare with other under it ?

May I ask a question , struts2 json and aop cglib when the asynchronous problem, thank you

 This post last edited by the ziyeibin on 2013-06-01 09:14:34
json serialization when the asynchronous get method , when in asynchronous error , can be used in the class @ JSON (serialize = false) solved, but also do not know why json serialization aop in the way, but do not know not really the problem,
exception as follows

2013-06-01 08:50:55,994 - org.apache.struts2.json.JSONWriter -140941 [http-8080-1] DEBUG  - com.bin.action.LoginAction.isExposeProxy()
java.lang.NoSuchMethodException: com.bin.action.LoginAction.isExposeProxy()
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
2013-06-01 08:50:55,995 - org.apache.struts2.json.JSONWriter -140942 [http-8080-1] DEBUG  - com.bin.action.LoginAction.isFrozen()
java.lang.NoSuchMethodException: com.bin.action.LoginAction.isFrozen()
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
at org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116)
at org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
at org.apache.struts2.json.JSONResult.execute(JSONResult.java:171)
2013-06-01 08:50:56,002 - org.apache.struts2.json.JSONWriter -140949 [http-8080-1] DEBUG  - 
java.lang.NullPointerException
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
at org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116)
at org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
at org.apache.struts2.json.JSONResult.execute(JSONResult.java:171)
2013-06-01 08:50:56,004 - org.apache.struts2.json.JSONWriter -140951 [http-8080-1] DEBUG  - com.bin.action.LoginAction.isPreFiltered()
java.lang.NoSuchMethodException: com.bin.action.LoginAction.isPreFiltered()
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
at org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116)
at org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
at org.apache.struts2.json.JSONResult.execute(JSONResult.java:171)
2013-06-01 08:50:56,004 - org.apache.struts2.json.JSONWriter -140951 [http-8080-1] DEBUG  - com.bin.action.LoginAction.getProxiedInterfaces()
java.lang.NoSuchMethodException: com.bin.action.LoginAction.getProxiedInterfaces()
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
at org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116)
at org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
at org.apache.struts2.json.JSONResult.execute(JSONResult.java:171)
2013-06-01 08:50:56,005 - org.apache.struts2.json.JSONWriter -140952 [http-8080-1] DEBUG  - com.bin.action.LoginAction.isProxyTargetClass()
java.lang.NoSuchMethodException: com.bin.action.LoginAction.isProxyTargetClass()
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
at org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116)
at org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
at org.apache.struts2.json.JSONResult.execute(JSONResult.java:171)
2013-06-01 08:50:56,006 - org.apache.struts2.json.JSONWriter -140953 [http-8080-1] DEBUG  - 
java.lang.NullPointerException
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
at org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116)
at org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
at org.apache.struts2.json.JSONResult.execute(JSONResult.java:171)
2013-06-01 08:50:56,007 - org.apache.struts2.json.JSONWriter -140954 [http-8080-1] DEBUG  - com.bin.action.LoginAction.getTargetClass()
java.lang.NoSuchMethodException: com.bin.action.LoginAction.getTargetClass()
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
at org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116)
at org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
at org.apache.struts2.json.JSONResult.execute(JSONResult.java:171)
2013-06-01 08:50:56,008 - org.apache.struts2.json.JSONWriter -140955 [http-8080-1] DEBUG  - com.bin.action.LoginAction.getTargetSource()
java.lang.NoSuchMethodException: com.bin.action.LoginAction.getTargetSource()
at java.lang.Class.getMethod(Unknown Source)
at org.apache.struts2.json.JSONWriter.findBaseAccessor(JSONWriter.java:294)
at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:202)
at org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178)
at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:168)
at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:134)
at org.apache.struts2.json.JSONWriter.write(JSONWriter.java:102)
at org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116)
at org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:197)
at org.apache.struts2.json.JSONResult.execute(JSONResult.java:171)


Action class :

package com.bin.action;
@Scope("prototype")
@Controller
public class LoginAction extends ActionSupport implements ServletRequestAware{
private static Logger log = Logger.getLogger(LoginAction.class);
@Resource
private LoginService loginService;
private HttpServletRequest request;

private User user;
private String msg;

public String execute() throws Exception {
if (user == null || user.getAccount().equals("")
|| user.getPassword().equals("")) {
return LOGIN;
}
User userInfo = loginService.getUserInfo(user.getAccount());
if (userInfo == null) {
setMsg("找不到该用户,请检查账户是否正确");
} else if (user.getPassword().equals(userInfo.getPassword())) {
setMsg("success");
ServletActionContext.getContext().getSession().put("user", userInfo);
} else if (!user.getPassword().equals(userInfo.getPassword())) {
setMsg("密码错误,请检查密码是否正确");
}
return SUCCESS;
}
@Override
public void setServletRequest(HttpServletRequest request) {
this.request = request;
}

public void setLoginService(LoginService loginService) {
this.loginService = loginService;
}
@JSON(serialize=false)
public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}
    
public String getMsg() {
return msg;
}

public void setMsg(String msg) {
this.msg = msg;
}
}


struts.xml
		<action name="login" class="loginAction">
<result type="json">
</result>
</action>

aop categories:

@Repository
@Aspect
public class ExceptionAspect {
   @Pointcut("execution(* com.bin.action.*.*(..) throws Exception)")  
    private void anyMethod() {}
  @AfterThrowing(pointcut="anyMethod()",throwing="e")  
    public void doAfterThrowing(JoinPoint jp,Exception e) {
        System.out.println("异常通知:"+jp.getSignature().getName());
        e.printStackTrace();
    }  



 <aop:aspectj-autoproxy  proxy-target-class="true"/>

Note that I cut with aop service layer is no problem , but I hope to be able to cut into the action this AOP layer , do not know the expression has no problem, thank you
------ Solution ---- ----------------------------------------
unfamiliar with the landlord said those things .
But the vast majority of cases java.lang.NoSuchMethodException this exception is the wrong version of a package . For example a.jar cited B.class (version1), but the landlord 's operating environment is more than a B.class or is there a wrong version of B.class.
------ For reference only - -------------------------------------


Thank you upstairs to answer
but not reported method is to write my own java:
eg : java.lang.NoSuchMethodException: com.bin.action.LoginAction.getTargetSource ()
java.lang.NoSuchMethodException: com.bin.action.LoginAction.getTargetClass ()

I did not write these methods go , this is a bit like aop in the way, but I could not find in the Aspect which seems appropriate method ,
I also tried some of the latest update package into the jar , but it does not work
------ For reference only ----------------- ----------------------
does not solve now , what is the reason , I also encountered the same problem , if the landlord is resolved, hoping to informed solutions should be grateful

【 】 Ewha rain scattered points , Videos of sharing

Well, maybe the words in the forum or sent to a little bit of risk ~ ~ ~

I appreciate the girl under the " pear rain " photos.

Background : Because unclear reasons unhappy, then cry splinters , hold out behind the coax to coax a smile on eyebrow open.





I wish you program apes who have a baby to grow up happily , no baby 's Early Takako , has not yet begun early arable enclosure ~ ~ ~
------ Solution ------- -------------------------------------
" to baby clothes ," when my father very happy bar. . . Vision in . . . .
------ Solution ---------------------------------------- ----
Wow, good Peugeot Yeah . . .
------ Solution - -------------------------------------------
good and sensuality , touch the face
------ Solution - -------------------------------------------
Results posted earlier , a person will be more
------ Solution ---------------------------------- ----------

------ Solution -------------------------------------- ------
be a good father is not simple .

I wish you happiness .
------ Solution ---------------------------------------- ----
see children on like pinching his face. .
------ Solution ---------------------------------------- ----
kawaii
------ Solution - -------------------------------------------

------ Solution ----- ---------------------------------------

------ For reference only ------- --------------------------------

------ For reference only -------------- -------------------------

SSH declare things management errors ?

1 Description:
Petty in ssh framework , configuration management declarations of things , start Tomcat error ! ! !


Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$ Proxy0 implementing service.EmployeeService, org.springframework.aop. SpringProxy, org.springframework.aop.framework.Advised] to required type [service.impl.EmployeeServiceImpl] for property 'employeeServiceImpl'; nested exception is java.lang.IllegalArgumentException : Cannot convert value of type [$ Proxy0 implementing service.EmployeeService, org.springframework.aop.SpringProxy, org.springframework.aop.framework.Advised] to required type [ service.impl.EmployeeServiceImpl] for property 'employeeServiceImpl': no ​​matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertForProperty (BeanWrapperImpl.java: 391)

2.application.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
">

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>

<!-- 配置Hibernate的管理实务 -->
     <bean id= "txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory" ref="sessionFactory"></property>
     </bean>
     
     <tx:advice id ="txAdvice" transaction-manager="txManager">
       <tx:attributes>
           <tx:method name="get*" read-only="true"/>
           <tx:method name="find*" read-only="true"/>
           <tx:method name="search*" read-only="true"/>
           <tx:method name="query*" read-only="true"/>
           <tx:method name="add*" propagation="REQUIRED"/>
           <tx:method name="del*" propagation="REQUIRED"/>
           <tx:method name="update*" propagation="REQUIRED"/>
           <tx:method name="do*" propagation="REQUIRED"/>
           <tx:method name="*"   read-only = "true"/>
       </tx:attributes>
     </tx:advice>
     
     <!-- aop -->
     <aop:config>
         <aop:pointcut id = "serviceMethod" expression = "execution(* service.impl.*.*(..))"></aop:pointcut>
         <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethod"></aop:advisor>
     </aop:config>
     
     
     


    <bean id= "userDao" class="dao.impl.EmployeeOperimpl">
        <property name="sessionFactory" ref= "sessionFactory"></property>
    </bean>
   
   <bean id = "userBiz" class="service.impl.EmployeeServiceImpl">
       <property name="employeeDao" ref="userDao"></property>
   </bean>    
   
   <bean id = "userAction" class= "web.action.userAction">
      <property name="employeeServiceImpl" ref="userBiz"/>
   </bean>
    



</beans>

3. business layer



------ Solution ------------------------------------ --------
this error as yours,
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [cn.edu.tjuci.ei_oa.biz.baseInfo.impl.OfficeInfoBizImpl] to required ; type [cn.edu.tjuci.ei_oa.bean.OfficeInfo] for property 'officeInfo'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [cn.edu.tjuci.ei_oa.biz.baseInfo.impl.OfficeInfoBizImpl] to required type [cn.edu.tjuci.ei_oa.bean.OfficeInfo] for property 'officeInfo': no matching editors or conversion strategy found

Error Analysis: In the program, there is one with the Id in Spring Bean class conflict , namely the same name, but different types. And set and get methods exist , Spring will automatically inject Bean.
Modify the name , you can
------ For reference only ------------------------- --------------

checked according to your ideas
First, make sure the preparation of a statement of things without error
So the console information, using Kingsoft translation of the next
found UserAction.
1. property 'employeeServiceImpl'
solve this error
application.xml file contains no errors
1.web.action.UserAction wrong
No -oriented programming interface .
implementation class is used instead of interfaces ,
AoP lead agency fails
 
 private EmployeeService employeeServiceImpl = null; //业务层接口
 private String sn;
 private String password;


SSH in hibernate a cache problem ( help )

SSH in dao layer is mainly responsible for the database CRUD ; business layer component of the facade is dao , dao by combining multiple functions needed to achieve business ;
Hibernate uses spring template HibernateTemplate, session agent is spring , spring is responsible for the closing session , such as:
public void save (Student transientInstance) {
log.debug ("saving Student instance");
try {
getHibernateTemplate (). save (transientInstance);
log.debug ("save successful");
} catch (RuntimeException re) {
log.error ("save failed", re);
throw re;
}
}
operation will automatically turn off after spring session, so session life cycle is too short it, a cache is not gone yet ?

public Student findById (java.lang.String id) {
log.debug ("getting Student instance with id:" + id);
try {
Student instance = (Student) getHibernateTemplate (). get (
"com.student.javabean.Student", id);
return instance;
} catch (RuntimeException re) {
log.error ("get failed", re);
throw re;
}
}



If the business layer has the following operations:
Student s = sdao.findById (sid);
Set courses = s.getCourses ();

will complain no session or session was closed
because the use of lazy loading , all will report this error . Description session has indeed been in dao layer closed.

If opensessionviewfilter ( extended session of the life cycle, from dao -> service -> Acion -> jsp (view) then close the session) Even so , session of a cache role seemingly not much ?
solving ?
or to give an example of practical use cache
------ Solution ------------ --------------------------------
a cache is a Session -level cache, it belongs transaction scope cache.

When the application calls the Session save (), update (), saveOrUpdate (), get () or load (), and call the query interface list (), iterate () or filter () method If the cache does not exist in the Session corresponding object , Hibernate will put the object into the first level cache. When clearing cache , Hibernate object- based cache state changes to synchronize update the database.

Overall : a cache to play a role mainly for long transaction operation, to reduce the frequency of interaction with the database frequently , such as : Select then continuously Update, final submission .
------ For reference only -------------------------------------- -
how Meirenhuida Yeah
------ For reference only ----------------------------- ----------
same question SSH integration , hibernate in a cache is not nothing a role ?

With a connection pool to connect to Oracle error occurred , look great God who is resolved. .

Oracle version : 12c
exception occurred : org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-28040: No matching authentication protocol
)
------ Solution ----------------------------------- ---------
no matching connection pool ?
------ Solution ---------------------------------------- ----
method 2:

jdbc package comes with oracle12c connect to the database .
------ For reference only -------------------------------------- -

connection pool properly. . . Focusing errors in parentheses . . .
------ For reference only ---------------------------------------
username password wrong ?
------ For reference only -------------------------------------- -


It should not be this wrong ah. .
------ For reference only -------------------------------------- -
seeking to answer ah , their top
------ For reference only ---------------------------------------
Zaiding once ! ! !
------ For reference only ---------------------------------------

  
It should not be this wrong ah. .  

you put your database connection configuration stickers ah.

ORA-28040: No matching authentication protocol
means: No matching authentication protocol

------ For reference only ---------------------------------- -----
modify oracle server sqlnet.ora file
only this attribute ( if any ) :
"SQLNET.ALLOWED_LOGON_VERSION = 9"
------ For reference only -------------------------- -------------

really do not. .
------ For reference only -------------------------------------- -
then another jdbc package it. 12c comes with
------ For reference only ------------------------------- --------


talent ah. . Can . . 12c really accustomed to ah. .
------ For reference only -------------------------------------- -

  
talent ah. . Can . . 12c really accustomed to ah. .  

can be posted on the knot , to sub it
------ For reference only ---------------------------------------

    
talent ah. . Can . . 12c really accustomed to ah. .          
  
can be posted on the knot , to sub it     

------ For reference only ---------------------------------------
landlord 12c of that jar package ?

struts2 wrong



Username :

Password :




Seeking a function , yyyy-mm-dd date format type subtraction short number of days to get a new date

For example 2010-01-05 obtained after adding 21 new date format for yyyy-mm-dd

Thank
------ Solution ---------------------------------- ----------
into milliseconds together, then format
------ Solution ----------------- ---------------------------

        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date date = format.parse("2010-01-05");
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        c.add(Calendar.DATE, 21);
        date = c.getTime();
        System.out.println(format.format(date));

------ Solution ------- -------------------------------------
Well , 2nd Floor positive solution . My project is a tool for these methods to the class to use.

Great God help ! Obtained from a database table into html and follow the original format to a word document

1, the others will be part of their word document saved to the database clob field, in order to save html ;
2, I need to get a table from the database into these fields have been saved and sorted according to a certain order after export to word document ;

The second step requires me to deal with , but have not encountered before, I do not know how to start.
currently only fields in the database can be displayed on the page with a textarea , but how to save the document to a word really does not . Ask god to help ah ! ! Background processing using java .
------ Solution ---------------------------------------- ----
have an existing implementation of poi:
http://blog.csdn.net/solidwang/article/details/5485423
------ For reference only -------------------------------------- -

Thank you, I see, I'll try it again if successful Results posted Kazakhstan

Urgent ! ! ! ! How to pass parameters in struts.xml to another action

Click to jump to action follows Replies

articleListAction


How to pass the ID value articleListAction Lane ? How to write ? Consult experts to answer !


/ bbs / article.jsp

------ Solution ------------------------------- -------------
looks like you can add in the url $ {ID}, type to "redirect"
------ Solution ------ --------------------------------------

点击回帖跳转到的action如下
<action name="postArticleAction" class="com.bbs.showAction" method="postArticle">
<result name="success" type="chain">articleListAction</result>
</action>

如何把ID值传给articleListAction里?怎么写?请教高手解答!

<action name="articleListAction" class="com.bbs.showAction" method="articleList">
<result name="success">/bbs/article.jsp</result>
</action>

postArticleAction could write showAction class plus an id attribute to provide geter seter can write
<action name="postArticleAction" class="com.bbs.showAction" method="postArticle">
<result name="success" type="chain">articleListAction.action?id=${id}</result>
</action>



------ Solution ------------------------------------ --------

articleListAction.action? ID = $ {ID}


articleListAction declare an ID variable , and provides set / get methods
------ For reference only --------------------- ------------------
the result of the type attribute to redirect, redirect
------ For reference only ------ ---------------------------------
then how to pass parameters?
------ For reference only -------------------------------------- -
articleListAction & xxx = yyy
------ For reference only --- ------------------------------------
that how to get inside this parameter in the ACTION ?
------ For reference only -------------------------------------- -
inside struts.xml configuration parameter is not passed , but in the concrete inside the given url

example you from a web component , such as a jsp, servlet even other struts Action class inside, can provide this parameter:

to jsp example: In the js inside :
document.forms [0]. action = "postArticleAction.do? id =" + id value of your
then submit

in your
com.bbs.showAction class inside :
By String id = request.getParameter ("id"); take this parameter
------ For reference only ------------- --------------------------
chain types can be defined inside
------ For reference only ---------------------------------------





------ For reference only ----------------------------- ----------
action jump you can put request.setAttruct ("id", xx) , so in articleListAction directly get in the way ,
they request the same directly to the articleListAction is taken on it
------ For reference only ------------------- --------------------
type = "chain" can also be removed
------ For reference only - -------------------------------------
<

<action name="postArticleAction" class="com.bbs.showAction" method="postArticle">
<result name="success" type="chain">articleListAction.action?id=${id}</result>
</action>


------ For reference only ---------------------------------- -----
LZ is under what circumstances need to use this pass by value ah ? Experienced friends also talk about chanting ?
------ For reference only -------------------------------------- -
I would like to pass a collection of how to pass ?
can not be used ? Mass participation
collection of very long
------ For reference only ------------------------------- --------

$ {ID}, what is the ID variable is defined in the file ? Files on what position do ?

Fundamental questions about a thread , a large head , depressed

This is an example from the Internet to find
class ThreadA
{
public static void main (String [] args)
{
ThreadB b = new ThreadB ();
b.start ();
System.out.println ("b is start ....");
synchronized (b)
{
try
{
System.out.println ("Waiting for b to complete ...");
b.wait ();
System.out.println ("Completed.Now back to main thread");
}
catch (InterruptedException e)
{
}
}
System.out.println ("Total is:" + b.total);
}
}

class ThreadB extends Thread
{
int total;
public void run ()
{
synchronized (this)
{
System.out.println ("ThreadB is running ..");
for (int i = 0; i <100; i + +)
{
total + = i;
System.out.println ("total is" + total);
}
notify ();
System.out.println ("ThreadB is finish ..");
}
}
}

ThreadA run the main program , the following is the result of the majority
b is start ....
ThreadB is running ..
total is 0
total is 1
total is 3
total is 6
............ ( this is the middle of the omitted results )
ThreadB is finish ..
Waiting for b to complete ...
Completed.Now back to main thread
Total is: 4950

But after running it several times , and sometimes the results will appear as though it is a small probability
b is start ....
ThreadB is running ..
total is 0
total is 1
total is 3
............ ( this is the middle of the omitted results )
ThreadB is finish ..
Waiting for b to complete ...
program is in an infinite wait state , unless I manually end

My question now is , according to the output of each ThreadB basically be able to grab the lock , and then to perform, so I think
should be the main thread each time an infinite wait state fishes , but the actual result is actually able to perform most complete , and that the wait method here , what role ? feel there is no work , wait not to say, the object of the thread holds the lock release the right, and then thread into a collection of objects waiting for you ? ThreadA here does not hold the object b is the main thread do ? Once we reach the wait method , the main thread should not hang you, he To continue, shall perform such other places notify you, but now than he first performed notify Yeah, that never have the thread wakes him die , how he will continue to enforce it ?

Please adequate guidance
------ Solution -------------------------------- ------------
My question now is , according to the output of each ThreadB basically be able to grab the lock , and then to perform, so I think
should be the main thread each time an infinite wait state fishes

========================
ThreadB are not always grab the lock ah, you say that basically it. And do not print so much, you sleep it. See clearly point .

public class ThreadA {
public static void main(String[] args) {
ThreadB b = new ThreadB();
b.start();
System.out.println("b is start....");
synchronized (b) {
try {
System.out.println("Waiting for b to complete...");
System.out.println("before wait...");
b.wait();
System.out.println("after wait...");
System.out.println("Completed.Now back to main thread");
} catch (InterruptedException e) {
}
}
System.out.println("Total is :" + b.total);
}
}

class ThreadB extends Thread {
int total;

public void run() {
synchronized (this) {
System.out.println("ThreadB is running..");
for (int i = 0; i < 10; i++) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
total += i;
System.out.println("total is " + total);
}
notify();
System.out.println("ThreadB is finish..");
}
}
}

two cases:
1, the main thread to run in ThreadB execution is performed prior to the sync block inside. That this is the case :
b is start ....
Waiting for b to complete ...
before wait ...
ThreadB is running ..
total is 0
total is 1
total is 3
total is 6
total is 10
total is 15
total is 21
total is 28
total is 36
total is 45
ThreadB is finish ..
after wait ...
Completed.Now back to main thread
Total is: 45

1, the main thread to run in ThreadB execution is performed after the sync block inside, and this on an infinite wait.

b is start ....
ThreadB is running ..
total is 0
total is 1
total is 3
total is 6
total is 10
total is 15
total is 21
total is 28
total is 36
total is 45
ThreadB is finish ..
Waiting for b to complete ...
before wait ...

------ For reference only ---------------------------------- -----
for this one
Once we reach the wait method , the main thread should not hang you, he would like to continue, other places may not perform notify you, but now than he first performed notify Yeah, that thread will never wake up he ah , how he will continue to enforce it ?

Waiting for b to complete ..
b.wait () ;/ / wait up here . Run it back there ?
System.out.println ("Completed.Now back to main thread");
------ For reference only ------------ ---------------------------
withheld good. You do not see it that fast execution . But it is still performed first and then the inside of the A to B .
------ For reference only -------------------------------------- -
Thank you ! ! ! really is such a thing

Thought should be regarded as a small problem

java
 This post last edited by the vampire_vivan on 2013-10-13 19:42:03

import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class DrawCircle extends JFrame {
private final int OVAL_WIDTH = 80;// 圆形的宽
private final int OVAL_HEIGHT = 80;// 圆形的高
public DrawCircle() {
super();
initialize();// 调用初始化方法
}
// 初始化方法
private void initialize() {
this.setSize(300, 200);// 设置窗体大小
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// 设置窗体关闭模式
setContentPane(new DrawPanel());// 设置窗体面板为绘图面板对象
this.setTitle("绘图实例2");// 设置窗体标题
}
public static void main(String[] args) {
new DrawCircle().setVisible(true);
}
// 创建绘图面板
class DrawPanel extends JPanel {
public void paint(Graphics g) {
super.paint(g);
g.drawOval(10, 10, OVAL_WIDTH, OVAL_HEIGHT); // 绘制1个圆形
}
}
}

I just want to ask , this code inside the two super statement What is the role ? After deletion , the results seemingly nothing changes ! What used to thinking of it ?
------ Solution ---------------------------------------- ----
first super constructor in DrawCircle years, so the role is to call the parent class constructor without parameters , the second super class in DrawPanel paint method , and is super.paint (g ) is to call the parent class's paint method , you say nothing changes after removal of the results that may DrawCircle is the parent class constructor and DrawPanel paint method for your results may just not work, such as the first one is to call the parent class constructor super function , which is an empty method , this time just as you do not affect the results , the use of super is hoped that the implementation of the parent class method
------ Solution ------------- -------------------------------
occurs when the class inheritance relationship,
subclass new object, we must first look at what the parent class data to be initialized because the subclass to use parent class's data, so the first line to the constructor . We all know that the system will default to provide a default no- argument constructor , when the parent class has no constructor with parameters , sub-class new object, you do not write with write super (), it does not matter , because the system provides . But when a parent class constructor with arguments , which is a subclass of new objects , according to your needs to specify the parent class constructor which has parameters , colleagues parent class constructor without parameters to display write out , or the compiler will complain .
------ Solution ---------------------------------------- ----
http://blog.sina.com.cn/s/blog_6d315ffd01014c0s.html
proposed landlord facie this
------ For reference only ----------------------------- ----------
plus super is to call the parent class's paint (Graphics g) method , without words is called a subclass .
here if not super , then I do not believe your program will not complain . Apparent infinite loop
public void paint (Graphics g) {
super.paint (g);
g.drawOval (10, 10, OVAL_WIDTH, OVAL_HEIGHT); ; / / Draw a circle
}
------ For reference only ----------------- ----------------------
constructor is only the first line of super, or this, you do not add the words , the compiler automatically add super ( );
------ For reference only ------------------------------------ ---

try it yourself to know ~
------ For reference only --------------------- ------------------

try it yourself know ~  



------ For reference only ----- ----------------------------------
in this program which is the first one constructor , add here with and without no relationship, but if you do not add the second , then that would definitely be wrong , because you are using a parent class method
------ For reference only ------ ---------------------------------

try it yourself know ~          
  
  
     
    
sorry, I mean to delete super.paint (g); phrase
I just want to know , you can add or not to add , why add ? Is there any tips
------ For reference only --------------------------------- ------

I just want to know , you can add or not to add , why add ? Is there any tips
------ For reference only --------------------------------- ------

try it yourself know ~                
    
    
         
              
sorry, I mean to delete super.paint (g); phrase   
I just want to know , you can add or not to add , why add ? Is there any tips  
That increase will not do,
because even without super, the constructor will be executed when the first implementation of the default constructor of the parent class .
------ For reference only -------------------------------------- -
plus super is called the father of the corresponding method , is completely rewritten without this method
------ For reference only --------------- ------------------------
me giddy . We soon learned ,
------ For reference only ------------------------------- --------
super () function : Create a subclass object created when a parent object , super () is equivalent to calling the default constructor of the parent class , you do not add a constructor execution it will let you create a parent class object
------ For reference only ------------------------- --------------

true, but in this code inside, did not see it added to what is the meaning
------ For reference only ---------------------------------------

true, but in this code inside, did not see it added to what is the meaning  
super.paint (g); That is because the parent class 's paint () has no effect subclass
------ For reference only ----- ----------------------------------

true, but in this code inside , did not see it added to what is the meaning          
super.paint (g); That is because the parent class 's paint () has no effect subclass  
+1

springMvc @ ResponseBody annotation problem

Recent projects need to learn springMvc, the project which is mainly used to annotate the way . Today, write a log in the example used
@ ResponseBody annotation , when there is a problem . , prompt information : The annotation @ RequestBody is disallowed for ; this location.
just learning , looking for a long time, scratching their heads , seeking god pointing. Online ! ! ! Thank you .
------ Solution ---------------------------------------- ----
LZ, is this @ ResponseBody it, your image is requestBody, wrong , right
------ Solution ---------------- ----------------------------
public String loginForm (@ RequestBody) {

}
------ Solution ----------------------------------- ---------
remember. Two things .

JSON into an array

[{'name':'li','age':'13'},{'name':'yang','age':'20'}...]
, similar to this , I want to get every one of the second attribute value corresponding note : there's a name and age are not fixed, so I'm thinking can turn into an array
[['li','13'],['yang','20']]
, so that you can subscript to the value of ?
------ Solution - -------------------------------------------
java can be directly traverse jsonArray of



String json = command.substring (6);
JSONArray jsonArray = (JSONArray) JSONSerializer.toJSON (json);
String json_c = jsonArray.getString (0);
JSONObject jsonObject = JSONObject.fromObject (json_c);
for (Iterator iter = jsonObject.keys (); iter.hasNext () ;) {/ / first object traversing the entire people
String key = (String) iter.next ();
System.out.println (key + "#" + jsonObject.getString (key));
}
------ Solution ------------------------------- -------------
var obj = [];
var o;
var d;
var t = [{
'name': 'li',
'age': '13'
},
{
'name': 'yang',
'age': '20'
}];
for (var i = 0; i < t.length; i++) {
o = t[i];
d = [];
for (var u in o) {
d.push(o[u]);
}
obj.push(d);
}

------ Solution --------------------- -----------------------

this ?

var t3="[['<a href=# onclick=openLink(14113295100,社旗县国税局桥头税务所,14113295100,d6d223892dc94f5bb501d4408a68333d,swjg_dm);>14113295100</a>','社旗县国税局桥头税务所','社旗县城郊乡长江路西段']]";  
//通过eval() 函数可以将JSON字符串转化为对象  
var obj = eval(t3);  
for(var i=0;i<obj.length;i++){  

alert(obj[i][1]);//输出第二个  

}  

this ?

------ For reference only ---------------------------------- -----

Oh , sorry , add Ha, I this is in JavaScript , and ask how to do it
------ For reference only ----- ----------------------------------

Oh , sorry , add Kazakhstan, I this is in JavaScript , may I ask how do  


jsonArray:
var data = [{name: "a", age: 12}, {name: "b", age: 11}, {name: "c", age: 13}, {name : "d", age: 14}];
for (var o in data) {
alert (o);
alert (data [o]);
alert ("text:" + data [o]. name + "value:" + data [o]. age);
}

If json string:

var t = "{'firstName': 'cyra', 'lastName': 'richardson', 'address': ; {'streetAddress': '1 Microsoft way', 'city': 'Redmond', 'state': 'WA', 'postalCode': 98052}, 'phoneNumbers': ['425-777-7777 ', '206-777-7777']} ";



var jsonobj = eval ('(' + t + ')') ;/ / single JSON object to add braces , JSON array is not required

alert (jsonobj.firstName);

alert (jsonobj.lastName);



------ For reference only ---------------------------------- -----

Oh , sorry , add Ha, I this is in JavaScript , and ask how to do it          
  
  
jsonArray:   
var data = [{name: "a", age: 12}, {name: "b", age: 11}, {name: "c", age: 13}, {name : "d", age: 14}];   
for (var o in data) {   
alert (o);   
alert (data [o]);   
alert ("text:" + data [o]. name + "value:" + data [o]. age);   
}   
  
If json string:   
  
var t = "{'firstName': 'cyra', 'lastName': 'richardson', 'address': ; {'streetAddress': '1 Microsoft way', 'city': 'Redmond', 'state': 'WA', 'postalCode': 98052}, 'phoneNumbers': ['425-777-7777 ', '206-777-7777']} ";   
  
  
  
var jsonobj = eval ('(' + t + ')') ;/ / single JSON object to add braces , JSON array is not required   
  
alert (jsonobj.firstName);   
  
alert (jsonobj.lastName);   
  
  
  Maybe you did not look carefully to my question , because I am the attribute name is not fixed , you can not pass . firstName way to get
------ For reference only ---------------------------------------
I try
- ----- For reference only ---------------------------------------
gray often swim ah !
------ For reference only ---------------------------------------

strange
this.JSON2Array=function(json){
var obj=[];
for(var o in json){
obj.push(json[o]);
}
alert('obj is Array?'+obj instanceof Array);//为什么是false?
return obj;
}

------ For reference only ----------------------------------- ----

strange   
this.JSON2Array=function(json){
var obj=[];
for(var o in json){
obj.push(json[o]);
}
alert('obj is Array?'+obj instanceof Array);//为什么是false?
return obj;
}
  forget parentheses , and laughed
- ----- For reference only ---------------------------------------
you do not know how pass . It is taken by the subscript
var obj = [];
var o;
var d;
var t = [{
'name': 'li',
'age': '13'
},
{
'name': 'yang',
'age': '20'
}];
for (var i = 0; i < t.length; i++) {
o = t[i];
d = [];
for (var u in o) {
d.push(o[u]);
}
obj.push(d);
}
  
alert(obj instanceof Array);  
alert(obj[0])
alert(obj[0][1])
//----
});
</script>

------ For reference only ----------------------------------- ----
json can be said to be object-oriented , and you turn into an array is not more trouble ?

Sogou , IE compatibility mode style Mansian --- 150 points seek expert look

Why Sogou and IE compatibility mode image carousel style dislocation , CHROME, FIREFOX no compatibility mode , no problem

just one set of the two DIV DIV, CSS cattle seeking analysis ! Wan Xie !

Website : www.javams.com, transferred compatibility mode , the right picture area messy . . . . .
------ Solution ---------------------------------------- ----
you look online IE and non- IE kernel What is the difference in the layout , the techniques used to contact you to determine whether the layout of the IE browser and then try
------ Solution --------------------------------------------
IE browser start adding the device from IE8 compatibility mode turned on will lower versions of IE for rendering. Compatibility mode may result page display problems , so we usually add the following code in the HTML to make IE rendering mode using fixed :



In another case, where only in IE8 compatibility mode is not used to display the page properly, but if set to IE8 mode in IE9 but it will lead CSS3 lapse. It seems , the need for IE8, IE9 disable compatibility mode , respectively . How to do it ? You can determine the version of the browser in the background , if it is IE8 to output content = "IE = 8", if it is IE9 will output content = "IE = 9". In fact, you can also simply achieved through HTML , HTML code is as follows :


After testing the perfect solution to the problem of the compatibility mode , so that the settings in IE compatibility mode set button will disappear , you can press F12 to open the "Developer Tools" to check the browser mode.
------ Solution ---------------------------------------- ----
Baidu default compatibility settings :


There are problems , the default is IE7, but the actual display, but need IE9

1, open the IE browser , hold down Alt, display the menu , click Tools , F12 Developer Tools

2, then set the document mode to IE9, other documents modes display problems .

------ Solution ------------------------------------ --------

  
F12 document mode to IE7 Standards have a problem ah   Thank you for help us to see
URL www.javams.com  

Oh, I saw no problem .
------ For reference only -------------------------------------- -
Sogou also ie kernel. ie core browser css parsing and firefox and chrome , there are some differences. You made it part of the code under the div . When I went back to have a computer look
------ For reference only ------------------------------ ---------

here, right ?
I use IE landing , temporarily not seen where there are problems .
------ For reference only -------------------------------------- -


You can view the source code can be seen right , thank
------ For reference only ---------------------- -----------------


Sogou and IE compatibility mode oh
------ For reference only --------------------------- ------------

  
Sogou Oh and IE compatibility mode  
Well, old, eyes always looking flowers. .
------ For reference only -------------------------------------- -


Big Niu Sogou compatibility mode solved

But when debugging F12 IE7 Standards Mode Select document can not be displayed , seeking final Weapon, Wan Xie


------ For reference only ----- ----------------------------------
 landlord to solve the problem, no ?

------ For reference only ---------------------------------- -----


F12 document mode to IE7 Standards have a problem ah Thank you for help us to see
Website www.javams.com
------ For reference only -------------------- -------------------
learn ~ !
------ For reference only ---------------------------------------
this is the default page in question , IE7 standards

this is to manually modify the default mode is IE9 standards document pages display properly !

------ For reference only ----- ----------------------------------

  
F12 document mode to IE7 Standards have a problem ah   Thank you for help us to see
URL www.javams.com  
Search : ie7 position relative

About PC client applications using JAVA as butcon

Asked a JAVA program on the PC before the problem is this

put the mouse died so


What is this control ?
or how to achieve it with the code
------ Solution -------------------------- ------------------
no need to repeat postings . . . See so few posts . .


GUI in
You give this button to add a mouse listener position ,
you put the mouse up, triggering the listener , and then change the background image on the line
------ Solution --------------------- -----------------------
package mkdemo; 
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JPanel; 
public class MouseMonitor extends JPanel {    
protected int _xPos     
protected int _yPos;     
public void tellMouseInfo(int x, int y) {        
_xPos = x;        
_yPos = y;        
repaint();    
}     
@Override     
protected void paintComponent(Graphics g) {        
super.paintComponent(g);
StringBuffer sbuf = new StringBuffer();         
sbuf.append("Mouse Location on screen: x = ");        
sbuf.append(String.valueOf(_xPos));        
sbuf.append(", y = ");         
sbuf.append(String.valueOf(_yPos));         
Rectangle rect = this.getBounds();         
g.drawString(sbuf.toString(), rect.x+20, (rect.y+rect.height)/2);    
}

------ Solution ----------- ---------------------------------
"swing also amazing" look at how to make the interface become beautiful : http://blog.csdn.net/withiter/article/details/7231394
------ Solution ---------------------------------------- ----

  
I just add the JToggleButton JToolBar remove border effects , but also      
  
surrounded button something like this how to remove ? and separated by vertical lines that point it can become  

setBorder (null) If not enough I do not know how to get the
------ For reference only -------------------- -------------------


moderator, I want to know the most is when no mouse put up a series of icons that is how to do ? Why do I use ImageButton appears around the protrusion is like a button that , and I take that example is a series of icons like together , which is what controls to achieve . Give me an example of what has . . JAVA UI for doing this I am a novice , never too done .
------ For reference only -------------------------------------- -

  
moderator, I want to know the most is when no mouse put up a series of icons that is how to do ? Why do I use ImageButton appears around the protrusion is like a button that , and I take that example is a series of icons like together , which is what controls to achieve . Give me an example of what has . . JAVA UI for doing this I am a novice , never too done .  
so will I find examples look
------ For reference only -------------------------- -------------

    
moderator, I want to know the most is when no mouse put up a series of icons that is how to do ? Why do I use ImageButton appears around the protrusion is like a button that , and I take that example is a series of icons like together , which is what controls to achieve . Give me an example of what has . . JAVA UI for doing this I am a novice , never too done .          
so will I look to find examples  

That really thank me for a long time , in fact, did not find such a feeling similar to this effect is very common. . Eclipse functionality with icons on the buttons are like
------ For reference only ------------------------- --------------
a JtoolBar plus button
------ For reference only --------------- ------------------------


I just add the JToggleButton JToolBar remove border effects , but also

surrounded button something like this how to remove ? and separated by vertical lines that point can become what
------ For reference only ------------------------- --------------
been resolved thank you
top

Why scanner has been thrown after this cycle ah

import java.io. *;
import java.util.InputMismatchException;
import java.util.Scanner;

public class basicType {

/ **
* @ param args
* /

public static void S_equals ()
{
String s1 = "abc", s2 = "abc";
System.out.println ("s1 equals s2 is" + s1.equals (s2));
System.out.println ("s1 equals \" abc \ "is" + s1.equals ("abc"));
System.out.println ("\" abc \ "equals \" abc \ "is" + "abc". equals ("abc")) ;
}

public static void N_scan ()
{
int sum = 0;
Scanner input = new Scanner (System.in);
System.out.print ("input 10 interger number:");
for (int i = 0; i <10; i + +)
{
int m = 0;
try {
m = input.nextInt ();
}
catch (InputMismatchException e) / / loop has been in this place seeking to explain ah
{
i -;
}
sum + = m;
}
System.out.println ("sum of the 10 Intergers is:" + sum);
}

public static void main (String [] args) {
/ / TODO Auto-generated method stub
S_equals ();
N_scan ();
}

}

------ Solution ------------------------------------ --------
you want users to the number of one-time output 10 Mody ? The logic that you are definitely wrong ah

give you a first input 10 the number of bars, 10 numbers separated by a comma when entered in accordance with the


import java.io.*;
import java.util.InputMismatchException;
import java.util.Scanner;

public class BasicType {



    public static void S_equals()
    {
        String s1="abc",s2="abc";
        System.out.println("s1 equals s2 is "+s1.equals(s2));
        System.out.println("s1 equals \"abc\" is "+s1.equals("abc"));
        System.out.println("\"abc\" equals \"abc\" is "+"abc".equals("abc"));
    }

    public static void N_scan()
    {
        int sum=0;
        Scanner scanner=new Scanner(System.in);
        System.out.print("input 10 interger number like 1,2,3 ...");
        String inputStr=scanner.next();
        String[] numStr=inputStr.split(",");
        for(String s:numStr){
             int value=Integer.parseInt(s);
             sum=sum+value;
        }
//        for(int i=0;i<10;i++)
//        {
//            int m=0;
//            try{
//                m=input.nextInt();
//            }
//            catch(InputMismatchException e) //一直在这个地方循环 求解释啊
//            {
//                i--;
//            }
//            sum+=m;
//        }
        System.out.println("sum of the 10 Intergers is:"+sum);
    }

    public static void main(String[] args) {
// TODO Auto-generated method stub
        S_equals();
        N_scan();
    }

}


------ Solution ------------------------------------- -------
try {
m = input.nextInt ();
}
catch (InputMismatchException e) / / loop has been in this place seek to explain ah
{
i -;
} sum + = m;
In sum + = m; few months before " ; "
can be added
try {
m = input.nextInt ();
}
catch (InputMismatchException e) / / loop has been in this place seek to explain ah
{
i -;
};
sum + = m;

------ Solution ------------------------------------ --------
Scanner delimiter mode using its input into tokens , so when you enter a tag with the pattern does not match the expected type occurs when InputMismatchException exception in your program for loop in the event of an anomaly, an exception will occur next time , think your input object or the object that the exception occurred ; would have been circulating as to why , it is because your program when an exception occurs i -, this is just the for loop i + + offset into an infinite loop . I tell you the program i - understanding is : When the input character and the expected type does not match mode , re-enter until the input type matching characters. So here is the program modifications:
for (int i = 0; i < 10; i++) {
int m = 0;
try {
m = input.nextInt();
} catch (InputMismatchException e) // 一直在这个地方循环 求解释啊
{
input = new Scanner(System.in);//当发生异常时,new一个新的Scanner对象
i--;
}
sum += m;
}

------ For reference only ----------------------------------- ----
nextLine () can each lose an integer knock one enter
------ For reference only ----------------- ----------------------
I entered a non-integer enter into an infinite loop will be sure to read the integer is not an integer then toss abnormal repeats the last read an integer

------ For reference only ---------------------------------- -----
have given you an example posted , did not see it ?


------ For reference only ---------------------------------- -----
examples need not because I do not want to hurry
------ For reference only --------------- ------------------------
you write this example would logically not normal , how do you make a sudden importer enter the numbers ?
separated by spaces ? program which specifically consider how you achieve it ?


------ For reference only ---------------------------------- -----
I use your code , how wrong it is not what you say :

in dos compile, run right
------ For reference only ---------------------- -----------------
you enter 10 integers it is right

------ For reference only ---------------------------------- -----
asked me to use
Scanner input = new Scanner (System.in);
hasNextInt () to determine whether the integer
if not how to use input.nextInt () reads the next few
------ For reference only -------------------- -------------------
will throw an exception if the direct reading
------ For reference only --------- ------------------------------

like the following passage from the first execution after each loop will execute the following period , it has been impossible to escape cycle

catch(InputMismatchException e) //一直在这个地方循环 求解释啊
{
i--;


------ For reference only ----------------------------------- ----
scanner very tasteless questions asked no way ah tangle me a few hours to continue efforts
------ For reference only ------ ---------------------------------
positive solution I have just found the answer
import java.io. *;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class basicType {

/ **
* @ param args
* /

public static void S_equals ()
{
String s1 = "abc", s2 = "abc";
System.out.println ("s1 equals s2 is" + s1.equals (s2));
System.out.println ("s1 equals \" abc \ "is" + s1.equals ("abc"));
System.out.println ("\" abc \ "equals \" abc \ "is" + "abc". equals ("abc")) ;
}

public static void N_scan ()
{
int sum = 0;
for (int i = 0; i <10; i + +)
{
int m = 0;
boolean flag = true;
System.out.print ("input an interger:");
while (flag)
{
Scanner input = new Scanner (System.in);
try
{
m = input.nextInt ();
flag = false;
}
catch (java.util.InputMismatchException e)
{
System.out.print ("wrong! not an interger! enter again:");
flag = true;
}
}
sum + = m;
}
System.out.println ("sum of the 10 intergers is:" + sum);
}

public static void main (String [] args) {
/ / TODO Auto-generated method stub
S_equals ();
N_scan ();
}

}

------ For reference only ---------------------------------- -----
try {
m = input.nextInt ();
}
catch (InputMismatchException e) / / loop has been in this place seek to explain ah
{
i -;
}
because every time you have done i - operation, if non-compliance with a number ( ie not here to type int ), nextInt method will always stay at this number does not match , while throwing abnormal , this time i have been doing i - operation , in a for loop just i + +, and now i -, equivalent to i has not changed, of course, would have been circulated
landlord should be logical errors , the i - deleted or changed on ok
------ For reference only ---------------- -----------------------
throw InputMismatchException when a scanner , the scanner will not pass mark that caused the exception , so you can get or some other method to skip it .
This is the java API documentation of the original words . This means that , if the method does not successfully resolve nextInt an integer , then your input will not be ignored. Because it might be resolved in other formats .
Then you enter a program , there was an exception , number 100 is assigned to begin the next cycle , but this time the data buffer you last entered a still, and not cleared , then continue parsing a, or wrong , so this process has been repeated anymore .
now you want to change is the input of the error clears , as long as the catch , add one : input.next () to get it !
Scanner can also be written in a try inside
------ For reference only -------------------------- -------------
speak great. . .
------ For reference only -------------------------------------- -



specially registered a number of points a praise

JSON string parsing

Following this json string. I how to resolve ah. . .
request code. . I always parse out or parse error . . .
parsed into objects directly , not parsed into JSONObject object. . .


{"id": 259, "displayImageUrl": "http: \ / \ / res2.aduu.cn \ / union \ / img \ / 201308 \ / 16110341_G4uN.gif", "description" : "1234156", "name": " professional, honest, efficient, convenient, students preferred brand : King Gillette ! "," packagename ":" com.zhuamob "," TrackingUrl ": {" showUrl ": [" http: \ / \ / api.adcome.cn \ / v1 \ / evt? sourceid = zhuamao & ; appid = debugdis01 & uuid = 862873023463216ec: 17:2 f: 9d: 5d: 3400000 & reqid = 4wqq345txtdldr4o & nettype = 1 & adid = 259 & appver = 1.0 & sdkver = 1.0 & evttype = 1 "]," clickUrl " ;: ["http: \ / \ / api.adcome.cn \ / v1 \ / evt? sourceid = zhuamao & appid = debugdis01 & uuid = 862873023463216ec: 17:2 f: 9d: 5d: 3400000 & reqid = 4wqq345txtdldr4o & nettype = 1 & adid = 259 & appver = 1.0 & sdkver = 1.0 & evttype = 2 "," http: \ / \ / proxy-beta.zhuamob.com? data =% 7B% 22status% 22% 3A% 224 % 22% 2C% 22web% 22% 3A% 7B% 22app_user_id% 22% 3A213701% 2C% 22app_id% 22% 3A1767% 2C% 22ad_id% 22% 3A100003% 2C% 22ad_user_id% 22% 3A100003% 2C% 22price% 22% 3A10 % 2C% 22ad_type% 22% 3A4% 2C% 22imei% 22% 3A% 22862873023463216% 22% 2C% 22mac% 22% 3A% 22ec% 3A17% 3A2f% 3A9d% 3A5d% 3A34% 22% 2C% 22url% 22% 3A % 22% 22% 2C% 22show_type% 22% 3A% 221% 22% 7D% 7D & t = d8b217068cbc5de0795bd8c3fbf "]," installUrl ": [" http: \ / \ / api.adcome.cn \ / v1 \ / evt? sourceid = zhuamao & appid = debugdis01 & uuid = 862873023463216ec: 17:2 f: 9d: 5d: 3400000 & reqid = 4wqq345txtdldr4o & nettype = 1 & adid = 259 & appver = 1.0 & sdkver = 1.0 & evttype = 3 " ;]}, "actionType": "2", "type": "4", "actionUrl": "http: \ / \ / 121.199.2.166:8080 \ / ad \ / adwap \ / 0701a \ / index.jsp? sno = zhuamao & media_id = debugdis01 & adId = 259 "}
------ Solution -------------------- ------------------------
you parse out the object is not JsonObject?
instead of an actual object ?
{"id": 259,. . . }
In fact, this should also have an outside object to contain , where it is called ad
like this post I've seen a similar .

If you want to create an ad in the form of objects , then we need to build a kind of ad , ad type below contains id, http , and so forth .
like TrackingUrl like this, then this is an object , then you need to create a TrackingUrl this object class , which contains the same information and so on. . .
to a similar analytical methods it:
http://bbs.csdn.net/topics/390337723
------ Solution ----------------------- ---------------------
no jar. Js test with no problem .
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
var t={
    "id": 259,
    "displayImageUrl": "http:\/\/res2.aduu.cn\/union\/img\/201308\/16110341_G4uN.gif",
    "description": "1234156",
    "name": "专业、诚信、高效、便捷,留学首选品牌:金吉列!",
    "packagename": "com.zhuamob",
    "TrackingUrl": {
        "showUrl": ["http:\/\/api.adcome.cn\/v1\/evt?

sourceid=zhuamao&appid=debugdis01&uuid=862873023463216ec:17:2f:9d:5d:3400000&reqid=4wqq345txtdldr4o&nettype=1&adid=259

&appver=1.0&sdkver=1.0&evttype=1"],
        "clickUrl": ["http:\/\/api.adcome.cn\/v1\/evt?

sourceid=zhuamao&appid=debugdis01&uuid=862873023463216ec:17:2f:9d:5d:3400000&reqid=4wqq345txtdldr4o&nettype=1&adid=259

&appver=1.0&sdkver=1.0&evttype=2", "http:\/\/proxy-beta.zhuamob.com?data=%7B%22status%22%3A%224%22%2C%22web%22%3A%7B%

22app_user_id%22%3A213701%2C%22app_id%22%3A1767%2C%22ad_id%22%3A100003%2C%22ad_user_id%22%3A100003%2C%22price%22%

3A10%2C%22ad_type%22%3A4%2C%22imei%22%3A%22862873023463216%22%2C%22mac%22%3A%22ec%3A17%3A2f%3A9d%3A5d%3A34%22%2C%

22url%22%3A%22%22%2C%22show_type%22%3A%221%22%7D%7D&t=d8b217068cbc5de0795bd8c3fbf"],
        "installUrl": ["http:\/\/api.adcome.cn\/v1\/evt?

sourceid=zhuamao&appid=debugdis01&uuid=862873023463216ec:17:2f:9d:5d:3400000&reqid=4wqq345txtdldr4o&nettype=1&adid=259

&appver=1.0&sdkver=1.0&evttype=3"]
    },
    "actionType": "2",
    "type": "4",
    "actionUrl": "http:\/\/121.199.2.166:8080\/ad\/adwap\/0701a\/index.jsp?sno=zhuamao&media_id=debugdis01&adId=259"
};
var subObj=t.TrackingUrl;
for (var i in subObj){
alert(i+"-->"+subObj[i]);
}
for (var i in t){
alert(i+"-->"+t[i]);
}
  
});
</script>
</head>
<body>

</body>
</html>

------ For reference only ----------------------------------- ----
there are many open source tools you can use ah

Gson pretty good , you go to google it , it will try to follow the examples used
------ For reference only ---------- -----------------------------

I use jsonObject
parse out is not my object
------ For reference only -------------------------- -------------
how you resolved ? Code does
------ For reference only -------------------------------- -------
you ask is what resolution ?

If js said they would not , would not want to get . . .


If it is pure java, can be considered to you I used to write packet
------ For reference only ------------------- --------------------




is that having JSONObject package . .
instead of js

------ For reference only ---------------------------------- -----

Why did not create many objects ?
------ For reference only -------------------------------------- -

Why did not create many objects ?  
no object What can you store these data