2

PHPテンプレートで物事を出力するこの方法を発見しました:

<body>
  my name is
  <?= $params['name'] ?>
  ...

それは次のようになります。

<body>
  my name is
  <?php echo $params['name'] ?>
  ...

これは非常にクールでクリーンな構文ですが、私の質問は次のとおりです。合法ですか? それとも非推奨ですか?


Weblogicでnullを与えるxmlInputFactory.createXMLStreamReader

Web アプリケーションでxmlコンテンツを作成しようとしています。そのために私はJAXBを使用しました。

JAXBContext jaxbContext = JAXBContext.newInstance(QueryRequest.class);

        XMLInputFactory xif = XMLInputFactory.newInstance();
        xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, false);
        StreamSource source = new StreamSource(new ByteArrayInputStream(
                queryRequestXml.getBytes()));

        XMLStreamReader xsr = xif.createXMLStreamReader(source);

        Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();

        QueryRequest queryRequest = (QueryRequest) jaxbUnmarshaller
                .unmarshal(xsr);

私が直面している問題は、JBOSS、Tomcat で正常に動作することです。しかし、アプリケーションを Weblogic に移動するとすぐにxif.createXMLStreamReader(source); nullとして。

これを修正する方法についてのアイデア。

4

1 に答える 1

3

Yes it's legitimate to use, however some times short tags are not enabled.

To turn them on if they are off, you can do this:

  1. go to php.ini file

  2. find, 'short_open_tag' and set it to on,

  3. restart the server

于 2013-10-21T09:01:21.323 に答える