@@ -72,6 +72,25 @@ class SoundManager;
7272typedef boost::function<WApplication* (const WEnvironment&)> ApplicationCreator;
7373#endif // !WT_TARGET_JAVA
7474
75+ #ifdef WT_TARGET_JAVA
76+ /* ! \brief An HTML Meta Header
77+ */
78+ #endif // WT_TARGET_JAVA
79+ struct MetaHeader {
80+ /* ! \brief Constructor
81+ *
82+ * Creates a meta header. The lang and user agents are optional, and should
83+ * be an empty string if not used.
84+ */
85+ MetaHeader (MetaHeaderType type, const std::string& name,
86+ const WString& content, const std::string& lang,
87+ const std::string& userAgent);
88+
89+ MetaHeaderType type;
90+ std::string name, lang, userAgent;
91+ WString content;
92+ };
93+
7594/* ! \class WApplication Wt/WApplication Wt/WApplication
7695 * \brief Represents an application instance for a single session.
7796 *
@@ -1642,33 +1661,36 @@ public:
16421661
16431662 /* ! \brief Adds an HTML meta header.
16441663 *
1645- * A meta header can only be added in the following situations:
1664+ * \sa addMetaHeader(MetaHeaderType, const std::string&, const WString&, const std::string&)
1665+ */
1666+ void addMetaHeader (const std::string& name, const WString& content,
1667+ const std::string& lang = " " );
1668+
1669+ /* ! \brief Adds an HTML meta header.
1670+ *
1671+ * This method sets either a "name" meta headers, which configures a
1672+ * document property, or a "http-equiv" meta headers, which defines
1673+ * a HTTP headers (but these latter headers are being deprecated).
1674+ *
1675+ * A meta header can however only be added in the following situations:
16461676 *
16471677 * - when a plain HTML session is used (including when the user agent is a
16481678 * bot), you can add meta headers at any time.
1649- *
16501679 * - or, when \ref progressive_bootstrap "progressive bootstrap" is
16511680 * used, you can set meta headers for any type of session, from
16521681 * within the application constructor (which corresponds to the
16531682 * initial request).
1654- *
16551683 * - but never for a Wt::WidgetSet mode application since then the
16561684 * application is hosted within a foreign HTML page.
16571685 *
1658- * When a header was previously set for the same \p name, its
1659- * contents is replaced.
1686+ * These situations coincide with WEnvironment::ajax() returning \c
1687+ * false (see environment()). The reason that it other cases the
1688+ * HTML page has already been rendered, and will not be rerendered
1689+ * since all updates are done dynamically.
16601690 *
1661- * These situations coincide with WEnvironment::ajax()
1662- * returning \c false (see environment()).
1663- */
1664- void addMetaHeader (const std::string& name, const WString& content,
1665- const std::string& lang = " " );
1666-
1667- /* ! \brief Adds an HTML meta header.
1668- *
1669- * This overloaded method allows to define both "name" meta headers,
1670- * relating to document properties as well as "http-equiv" meta
1671- * headers, which define HTTP headers.
1691+ * As an alternative, you can use the <meta-headers>
1692+ * configuration property in the configuration file, which will be
1693+ * applied in all circumstances.
16721694 *
16731695 * \sa removeMetaHeader()
16741696 */
@@ -2103,15 +2125,6 @@ private:
21032125 bool operator == (const ScriptLibrary& other) const ;
21042126 };
21052127
2106- struct MetaHeader {
2107- MetaHeader (MetaHeaderType type, const std::string& name,
2108- const WString& content, const std::string& lang);
2109-
2110- MetaHeaderType type;
2111- std::string name, lang;
2112- WString content;
2113- };
2114-
21152128 struct MetaLink {
21162129 MetaLink (const std::string &href,
21172130 const std::string &rel,
0 commit comments