2014-01-10 4 views
1

나는 인터넷을 통해 모든 것을 해왔으며, 뭔가 명확히하기 위해 곧바로 답을 얻는 것처럼 보일 수 없다.GWT에서 사용자 정의 클래스를 찾을 수 없습니까?

서버에서 ArrayList를 반환하려면 웹 응용 프로그램이 필요합니다. Por는 Serializable을 구현하고 GWT에 대해 직렬화 가능하다는 것을 알 수 있었던 모든 규칙을 따르는 사용자 정의 클래스입니다.

<source path='com.pbot'/> 

및 (포 포함) 내 모든 사용자 정의 클래스는 같은 com.pbot 패키지에 있습니다 (com.pbot 패키지)

내 gwt.xml 파일이 있습니다. 하지만 여전히 "소스 코드가 com.pbot.Por 유형에 사용할 수 없습니다. 필요한 모듈을 상속하는 것을 잊었습니까?" 메시지. com.pbot을 소스로 사용하여 두 번째 gwt.xml을 만들고 가져와야합니까? 그렇다면 어떻게 그것을 할 수 있습니까? 어디에 넣어야합니까? 그렇지 않다면 나는 무엇을 놓치고 있습니까? 아래

전체 gwt.xml 코드 :

<?xml version="1.0" encoding="UTF-8"?> 
<!-- 
    When updating your version of GWT, you should also update this DTD reference, 
    so that your app can take advantage of the latest GWT module capabilities. 
--> 
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" 
    "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd"> 
<module rename-to='pbot'> 
    <!-- Inherit the core Web Toolkit stuff.      --> 
    <inherits name='com.google.gwt.user.User'/> 

    <!-- Inherit the default GWT style sheet. You can change  --> 
    <!-- the theme of your GWT application by uncommenting   --> 
    <!-- any one of the following lines.       --> 
    <inherits name='com.google.gwt.user.theme.clean.Clean'/> 
    <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> --> 
    <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> --> 
    <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>  --> 

    <!-- Other module inherits          --> 

    <!-- Specify the app entry point class.       --> 
<entry-point class='com.pbot.client.Pbot'/> 
    <!-- Specify the paths for translatable code     --> 
    <source path='client'/> 
    <source path='shared'/> 
    <source path='com.pbot'/> 

</module> 

답변

1

그렇게

<source path=''/> 

대신

<source path='com.pbot'/> 

하지만 여전히 난 당신이 올바른 패키지로 사용자 정의 클래스를 넣어해야한다고 생각 추가 Por의 경우 공유 패키지 (클라이언트 측 및 서버 측에서 Por를 사용하고 있기 때문에). 그러나, 나는 상황을 알지 못한다. (그렇게 할 수 있다면) 그것은 단지 조언 일 뿐이다.

그 이유는 전체 패키지 com.pkg를 JavaScript로 번역하여 제공하기 때문에 조만간이 태도에 문제가 생길 수 있기 때문입니다. 그래서 가장 좋은 방법은 맞춤 클래스를 클라이언트 또는 공유 패키지에 넣은 다음 가능한 경우 제거하는 것입니다.

<source path=''/> 
관련 문제