小编Jul*_*eau的帖子

使用JAXB的@XmlEnum属性

我有一个问题,用jaxb创建枚举来生成我想要的xml,我试图使用@xmlEnum注释但不使用属性!

我会举一个例子来澄清:

XML

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<FilePollerConfiguration configFilePath="">
    <Directory path="C://Users//jmoreau040612//Desktop//Old">
        <Match pattern="*.xml">
            <Event name="create | modify | delete"> //here i want the enum in attribute
           <FTPSend>
          <FTPServer>toto.sgcib.com</FTPServer>
          <FTPPort>21</FTPPort>
          <FTPLogin>toto</FTPLogin>
          <FTPPassword>titi</FTPPassword>
                  <FTPDestinationPath>/root/src</FTPDestinationPath>
      </FTPSend>
       </Event>
   </Match>
   <Match pattern="*.csv">
       <Event name="create | modify | delete"> //here i want the enum in attribute
           <MailSend>
           <SMTPServer>smtp.fr.socgen</SMTPServer>
           <SMTPPort>25</SMTPPort>
           <MailTo>toto@sgcib.com</MailTo>
           <MailFrom>titi@sgcib.com</MailFrom>
           <Subject>tata</Subject>
           <Body>blabla</Body>
       </MailSend>
        </Event>
    </Match>
</Directory>
</FilePollerConfiguration>
Run Code Online (Sandbox Code Playgroud)

和我有塔下面的代码的Java部分:

@XmlAccessorType(XmlAccessType.FIELD)
public class Event {

     //I would like this enum in attribute of "Event" …
Run Code Online (Sandbox Code Playgroud)

java xml enums jaxb

3
推荐指数
1
解决办法
2万
查看次数

Angular routeProvider

我刚刚在youtube上关注了有关角度的教程,但由于出现routeProvider问题,我无法执行代码.我试图包含angular-route.js的好链接,但它仍然不起作用......

我给你看了代码:

<!DOCTYPE html>
<html ng-app="demoApp">
<head>
    <title>Tuto Angular</title>
</head>
<body>
    <div>
        <div ng-view=""></div>
    </div>

    <script src="angular.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-route.js"></script>
    <script type="text/javascript">

        var demoApp = angular.module('demoApp', ['ng-route']);

        demoApp.config(function ($routeProvider){
            $routeProvider
                .when('/',
                {
                    controller: 'SimpleController',
                    templateUrl: 'Partials/View1.html'
                })
                .when('/view2',{
                    controller: 'SimpleController',
                    templateUrl: 'Partials/View2.html'
                })
                .otherwise({ redirectTo: '/' });
        });

        demoApp.controller('SimpleController', function ($scope){
            $scope.customers = [
                {name:'John Smith', city:'Phoenix'}, 
                {name:'John Doe', city:'New York'}, 
                {name:'Jane Doe', city:'Chicago'}
            ];

            $scope.addCustomer = function (){
                $scope.customers.push(
                    { 
                        name: $scope.newCustomer.name,
                        city: $scope.newCustomer.city …
Run Code Online (Sandbox Code Playgroud)

routes angularjs route-provider

2
推荐指数
1
解决办法
844
查看次数

标签 统计

angularjs ×1

enums ×1

java ×1

jaxb ×1

route-provider ×1

routes ×1

xml ×1